Bob Sneidar wrote: > I have 2 variables: > > theSourceFile which is binfile:/Users/bobsneidar/Documents/Livecode > Projects/Forms Generator/Installs/1105 Media Inc/Chatsworth/20140805 >-Service Invoice.pdf > TheDestFile which is binfile:/Users/bobsneidar/Desktop/Install > Forms/1105 Media Inc/Chatsworth/20140805-Service Invoice.pdf > > I issue the command: put URL theSource into URL theDestination. > Nothing happens. No file gets copied. Is URL bin file deprecated?? > > I then, thinking I misunderstood the put URL command, opened > theSourceFile (after removing the binfile: part) for binary read. > I then read the data until eof (the it variable shows binary data). > I then opened theDestFile for write (also after removing the binfile: > part) and wrote it then closed the file. STILL there is nothing! > > I’ve run into this before. I changed permissions to everyone write, > still nothing. What am I doing wrong? Here is the code: > > open file theSourceFile for binary read > read from file theSourceFile until eof > close file theSourceFile > put it into theSourceData > > open file theDestFile for binary write > write theSourceData to file theDestFile > close file theDestFile
You're not using the URL syntax, but both the URL method and open/write/close should work, with both text and binary modes.
To diagnose problems with file access (and many other circumstances where error-checking is useful), check the result after attempting the action. With file access it can be very help to include a call to sysError there, so you can see what the OS is complaining about, .e.g:
open file theDestFile for binary write if the result is not empty then answer the result &"("& sysError() &")" end if -- Richard Gaskin Fourth World Systems Software Design and Development for the Desktop, Mobile, and the Web ____________________________________________________________________ ambassa...@fourthworld.com http://www.FourthWorld.com _______________________________________________ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode