{"id":49840,"date":"2020-08-04T03:01:41","date_gmt":"2020-08-03T17:01:41","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/ITblog\/?p=49840"},"modified":"2020-08-03T19:54:41","modified_gmt":"2020-08-03T09:54:41","slug":"download-and-copy-or-move-primer-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/download-and-copy-or-move-primer-tutorial\/","title":{"rendered":"Download and Copy or Move Primer Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/Mac\/download_ksh.jpg\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Download and Copy or Move Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/Mac\/download_ksh.jpg\" title=\"Download and Copy or Move Primer Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">Download and Copy or Move Primer Tutorial<\/p><\/div>\n<p>Downloading from &#8220;the net&#8221; (&#8220;server land&#8221;) to your computer or device (&#8220;client land&#8221;) is a big part of the online experience and the sharing of data over the world wide web.  But have you ever wondered about the two step design of &#8230;<\/p>\n<ol>\n<li>download from &#8220;the net&#8221; to a Downloads folder on your computer or device &#8230; and more often than not &#8230;<\/li>\n<li>you, the user, copies or renames this data to another location on your computer or device with command line or with operating system GUI<\/li>\n<\/ol>\n<p>&#8230; ? Why not allow the &#8220;server&#8221; side define where it can download to on the &#8220;client&#8221;?  Well, that would be a security nightmare, allowing a highjacking of mission critical files on your computer or device.  So, I get it, that is a &#8220;no no&#8221;.  But could we have a controlled &#8220;arrangement&#8221; between &#8230;<\/p>\n<ul>\n<li>the &#8220;server&#8221; side web applications\/pages &#8230; and &#8230;<\/li>\n<li>a &#8220;client&#8221; side listener (like we talked about with Korn Shell listeners with <a target=_blank href='https:\/\/www.rjmprogramming.com.au\/ITblog\/pandoc-document-conversion-email-tutorial\/' title='Pandoc Document Conversion Email Tutorial'>Pandoc Document Conversion Email Tutorial<\/a>)<\/li>\n<\/ul>\n<p> &#8230; ?  We think that sounds reasonable and so, today, we start our (two parts or more) mini-project (making step 2 above be considered to be programmatically handled, sometimes) designing a Korn Shell (&#8220;client&#8221; side) listener to suit our macOS &#8220;client&#8221; computer, executed as a background process via &#8230;<\/p>\n<p><code><br \/>\nksh <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/download_copier.ksh_GETME\" title=\"download_copier.ksh\">download_copier.ksh<\/a> &<br \/>\n<\/code><\/p>\n<p>But what is the conduit, if the &#8220;server&#8221; web applications\/pages cannot define a destination folder other than the macOS Downloads folder for the user involved?  Well, that is where we need either &#8230;<\/p>\n<ul>\n<li>Korn Shell interactive input (via <a target=_blank title='read' href='http:\/\/linuxcommand.org\/lc3_man_pages\/readh.html'>read<\/a> command) &#8230; or &#8230;\n<li>additional argument &#8230; as per example &#8230;<br \/>\n<code><br \/>\nksh <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/download_copier.ksh_GETME\" title=\"download_copier.ksh\">download_copier.ksh<\/a> <a target=_blank title='MAMP for Apache\/PHP\/MySql on Mac OS X local web server ... this is a macOS default Document Root folder name' href='http:\/\/www.mamp.info'>\/Applications\/MAMP\/htdocs\/<\/a> &<br \/>\n<\/code><br \/>\n &#8230; if the folder to copy to is known ahead of time\n<\/li>\n<\/ul>\n<p> &#8230; to define a &#8220;client land&#8221; folder to copy to (from the user&#8217;s Download folder (receiving the downloaded data).<\/p>\n<p>That first Korn Shell <a target=_blank title='read' href='http:\/\/linuxcommand.org\/lc3_man_pages\/readh.html'>read<\/a> command interactive input was interesting to us for a command backgrounded via the &#8220;&#038;&#8221; command suffix.  But if stdin and stdout are not mentioned in the command you can answer this interactive input and then the processing the Korn Shell performs proceeds in the background.  Exactly what we were hoping for, but weren&#8217;t sure that this was the case!<\/p>\n<p>The picture is filled in better tomorrow as we discuss the conduit in more detail tomorrow.<\/p>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d49840' onclick='var dv=document.getElementById(\"d49840\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/download\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d49840' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Downloading from &#8220;the net&#8221; (&#8220;server land&#8221;) to your computer or device (&#8220;client land&#8221;) is a big part of the online experience and the sharing of data over the world wide web. But have you ever wondered about the two step &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/download-and-copy-or-move-primer-tutorial\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,29,37],"tags":[126,212,233,234,3372,265,322,1750,360,621,677,734,2178,744,997,2401,1872,1122,1319],"class_list":["post-49840","post","type-post","status-publish","format-standard","hentry","category-elearning","category-operating-system","category-tutorials","tag-background","tag-client","tag-command","tag-command-line","tag-computer","tag-copy","tag-device","tag-document-root","tag-download","tag-internet","tag-korn-shell","tag-macbook-pro","tag-macos","tag-mamp","tag-programming","tag-read","tag-rename","tag-server","tag-tutorial"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/49840"}],"collection":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/comments?post=49840"}],"version-history":[{"count":4,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/49840\/revisions"}],"predecessor-version":[{"id":49844,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/49840\/revisions\/49844"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=49840"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=49840"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=49840"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}