Re: Monitor Shell Copy File Progress
I bet you could use cURL for this, using the FILE protocol. Build your curl command line with filenames formatted for curl; open it as a process for read; read that process's output every 500 msecs or so to get the progress info. I'm on assignment in NZ right now so I don't have everything at my fingertips. Josh Mellicker made me aware of curl a few months ago, and Ken Ray may have made a rev library of it by now. ;-) Also Mark Smith created a rev curl lib some time ago. Food for thought... Phil Davis On 23/05/10 12:26 PM, Alex Tweedly wrote: First thought : I thought (according to Dictionary) that "shell" would wait until the command was complete before returning - dictionary says The current handler pauses until the shell returns its result. If the command was successful but did not return anything, the shell function returns empty. Second try : why take a checksum, why not just use the file size ? Getting the checksum may involve copying the file from the remote server into your laptop to calculate the checksum. Third try : instead of doing "shell 'cp file ' " could you do load url ("file:" & tRemotepathname) check the cachedURLs put url("file:" & tRemotepathname) into url('file:" & tLocalfilename) -- Alex. On 22/05/2010 23:35, Sivakatirswami wrote: Work working on an in-house file manager - RCS for Indesign (since Adobe did an "end of life" for Version Cue) It's coming along well, in fact really well. One challenge is that I'm using lots of these: put ("mv " & quote & gLocalFilePath & quote &" "& quote & (gLocalProjectPath& "/"& tShortFileName) & quote) into tShell get shell (tShell) put ("cp " & quote & (gLocalProjectPath& "/"& tShortFileName) & quote &" "& quote & (gServerProjectPath& "/"& tShortFileName) & quote) into tShell get shell (tShell) to more files around and rename them... it works great. Is there a way to monitor a background shell process like this? The problem is if you copy from the Big Server on the LAN... to my Little MacBook Pro... you won't know when the file is completely copied to the local hard drive before doing: launch (gLocalProjectPath &"/" & pFileName) with the uInDesignPath of this stack Typically RunRev will issue the unix cp command and then immediately launch inDesign, which "crokes" because the file is incomplete on the local hard drive. Now I have some ideas about how to do this: get the checksum some of the remote file, do a send in 30 ticks (repeatedly) test of the local file until the local file's checksum matches the remote file and then launch it. But before I go after this, I was wondering if anyone had any other method? Most "cool" would be a progress bar, but I'm not sure RunRev can monitor a local unix copy file processor, if it can, how to do it. Thanks! Sivakatirswami ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: Monitor Shell Copy File Progress
Aloha, Alex: Nalla Cintanai (Tamil for "good thoughts" also the name of a famous book in our tradition) Hmmm, I will have to test that "wait" for shell completion. I'm not seeing that behavior at the moment, it sure seems like the next line runs immediately. I'll throw in an a put statement dialog immediately and watch. I think libURL uses the HTTP protocol. I'm thinking AFP will be faster and "better" Yes, Filesize, Oh, right... checksum is the wrong thing. I meant to parse the detailed files and use that. On 5/22/10 2:26 PM, Alex Tweedly wrote: First thought : I thought (according to Dictionary) that "shell" would wait until the command was complete before returning - dictionary says The current handler pauses until the shell returns its result. If the command was successful but did not return anything, the shell function returns empty. Second try : why take a checksum, why not just use the file size ? Getting the checksum may involve copying the file from the remote server into your laptop to calculate the checksum. Third try : instead of doing "shell 'cp file ' " could you do load url ("file:" & tRemotepathname) check the cachedURLs put url("file:" & tRemotepathname) into url('file:" & tLocalfilename) -- Alex. On 22/05/2010 23:35, Sivakatirswami wrote: I'm using lots of these: put ("cp " & quote & (gLocalProjectPath& "/"& tShortFileName) & quote &" "& quote & (gServerProjectPath& "/"& tShortFileName) & quote) into tShell get shell (tShell) to more files around Is there a way to monitor a background shell process like this? The problem is if you copy from the Big Server on the LAN... to my Little MacBook Pro... you won't know when the file is completely copied to the local hard drive before doing: launch (gLocalProjectPath &"/" & pFileName) with the uInDesignPath of this stack Typically RunRev will issue the unix cp command and then immediately launch inDesign, which "crokes" because the file is incomplete on the local hard drive. ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: Monitor Shell Copy File Progress
First thought : I thought (according to Dictionary) that "shell" would wait until the command was complete before returning - dictionary says The current handler pauses until the shell returns its result. If the command was successful but did not return anything, the shell function returns empty. Second try : why take a checksum, why not just use the file size ? Getting the checksum may involve copying the file from the remote server into your laptop to calculate the checksum. Third try : instead of doing "shell 'cp file ' " could you do load url ("file:" & tRemotepathname) check the cachedURLs put url("file:" & tRemotepathname) into url('file:" & tLocalfilename) -- Alex. On 22/05/2010 23:35, Sivakatirswami wrote: Work working on an in-house file manager - RCS for Indesign (since Adobe did an "end of life" for Version Cue) It's coming along well, in fact really well. One challenge is that I'm using lots of these: put ("mv " & quote & gLocalFilePath & quote &" "& quote & (gLocalProjectPath& "/"& tShortFileName) & quote) into tShell get shell (tShell) put ("cp " & quote & (gLocalProjectPath& "/"& tShortFileName) & quote &" "& quote & (gServerProjectPath& "/"& tShortFileName) & quote) into tShell get shell (tShell) to more files around and rename them... it works great. Is there a way to monitor a background shell process like this? The problem is if you copy from the Big Server on the LAN... to my Little MacBook Pro... you won't know when the file is completely copied to the local hard drive before doing: launch (gLocalProjectPath &"/" & pFileName) with the uInDesignPath of this stack Typically RunRev will issue the unix cp command and then immediately launch inDesign, which "crokes" because the file is incomplete on the local hard drive. Now I have some ideas about how to do this: get the checksum some of the remote file, do a send in 30 ticks (repeatedly) test of the local file until the local file's checksum matches the remote file and then launch it. But before I go after this, I was wondering if anyone had any other method? Most "cool" would be a progress bar, but I'm not sure RunRev can monitor a local unix copy file processor, if it can, how to do it. Thanks! Sivakatirswami ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Monitor Shell Copy File Progress
Work working on an in-house file manager - RCS for Indesign (since Adobe did an "end of life" for Version Cue) It's coming along well, in fact really well. One challenge is that I'm using lots of these: put ("mv " & quote & gLocalFilePath & quote &" "& quote & (gLocalProjectPath& "/"& tShortFileName) & quote) into tShell get shell (tShell) put ("cp " & quote & (gLocalProjectPath& "/"& tShortFileName) & quote &" "& quote & (gServerProjectPath& "/"& tShortFileName) & quote) into tShell get shell (tShell) to more files around and rename them... it works great. Is there a way to monitor a background shell process like this? The problem is if you copy from the Big Server on the LAN... to my Little MacBook Pro... you won't know when the file is completely copied to the local hard drive before doing: launch (gLocalProjectPath &"/" & pFileName) with the uInDesignPath of this stack Typically RunRev will issue the unix cp command and then immediately launch inDesign, which "crokes" because the file is incomplete on the local hard drive. Now I have some ideas about how to do this: get the checksum some of the remote file, do a send in 30 ticks (repeatedly) test of the local file until the local file's checksum matches the remote file and then launch it. But before I go after this, I was wondering if anyone had any other method? Most "cool" would be a progress bar, but I'm not sure RunRev can monitor a local unix copy file processor, if it can, how to do it. Thanks! Sivakatirswami ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution