put url tricks to copy files on windows

Mike Kerner MikeKerner at roadrunner.com
Tue Jun 20 22:19:00 EDT 2017


I'm not on a mac a lot :-(
So is "binfile:" more universal, or do I have to check the platform,
first?  What is the technique on linux?

On Tue, Jun 20, 2017 at 10:09 PM, Roger Eller via use-livecode <
use-livecode at lists.runrev.com> wrote:

> You're not on a Mac anymore.  ;-p
>
> I second the suggestion to lose the // if the platform is Windows.
>
> ~Roger
>
> On Jun 20, 2017 5:39 PM, "Mike Kerner via use-livecode" <
> use-livecode at lists.runrev.com> wrote:
>
> > In case it helps, here's the entire routine.  This works on a Mac.
> >
> > on copyFilesNFolders fromFolder toFolder
> >   if there is not a folder toFolder then
> >     create folder toFolder
> >     if the result is not empty then
> >       put the result into theResult
> >       errlog theResult
> >       quit
> >     end if #the result is not empty
> >   end if #there is not a folder toFolder
> >
> >   put folders(fromFolder) into folderList
> >   #<walk the folders recursively>
> >     repeat for each line folderName in folderList
> >       if char 1 of folderName is "." then next repeat
> >       copyFilesNFolders (fromFolder&slash&folderName),
> > (toFolder&slash&folderName)
> >     end repeat #for each line folderName in folderList
> >   #</walk the folders recursively>
> >
> >   #<now we're a the bottom for this folder.  Copy the folder and then the
> > files in the folder>
> >     put the defaultFolder into theDefaultFolder
> >     set the defaultFolder to fromFolder
> >     put the files into theFiles
> >     repeat for each line theFile in theFiles
> >       if char 1 of theFile is "." then next repeat #skip all the
> invisible
> > files like .DS_STORE
> >       put fromFolder&slash&theFile into fromFile
> >       put toFolder&slash&theFile into toFile
> >       if there is not a file toFile then
> >         put url ("binfile://" &fromFile) into url ("binfile://" &toFile)
> >         if the result is not empty then
> >           put the result into theResult
> >           errlog theResult
> >           breakpoint
> >           quit
> >         end if #the result is not empty
> >       end if #there is not a file toFile
> >     end repeat #for each line theFile in theFiles
> >     set the defaultFolder to theDefaultFolder
> >   #</now we're a the bottom for this folder.  Copy the folder and then
> the
> > files in the folder>
> > end copyFilesNFolders
> >
> > On Tue, Jun 20, 2017 at 5:34 PM, Mike Kerner <MikeKerner at roadrunner.com>
> > wrote:
> >
> > > I'm trying to use the put url technique to copy files on windows, but
> I'm
> > > getting "can't open file"
> > > If I do something like
> > > answer line 1 of url ("binfile://"&filename)
> > > I get what I expect, but when I try to
> > > put url ("binfile://"&filename) into url ("binfile://"&toFilename)
> > > I get "can't open file" in the result
> > >
> > > --
> > > On the first day, God created the heavens and the Earth
> > > On the second day, God created the oceans.
> > > On the third day, God put the animals on hold for a few hours,
> > >    and did a little diving.
> > > And God said, "This is good."
> > >
> >
> >
> >
> > --
> > On the first day, God created the heavens and the Earth
> > On the second day, God created the oceans.
> > On the third day, God put the animals on hold for a few hours,
> >    and did a little diving.
> > And God said, "This is good."
> > _______________________________________________
> > use-livecode mailing list
> > use-livecode at lists.runrev.com
> > Please visit this url to subscribe, unsubscribe and manage your
> > subscription preferences:
> > http://lists.runrev.com/mailman/listinfo/use-livecode
> >
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>



-- 
On the first day, God created the heavens and the Earth
On the second day, God created the oceans.
On the third day, God put the animals on hold for a few hours,
   and did a little diving.
And God said, "This is good."



More information about the use-livecode mailing list