Re: How can I tell if server ftp folder upload is finished?
Re: How can I tell if server ftp folder upload is finished?
- Subject: Re: How can I tell if server ftp folder upload is finished?
- From: Chris Page <email@hidden>
- Date: Wed, 03 Jun 2009 17:40:18 -0700
On Jun 3, 2009, at 6:47 AM, Brian Christmas wrote:
I've got an unusual scenario.
No, you don’t. :-)
The server is a darn PC so I can't use folder action scripts on it,
but it would be nice to only trigger the monitoring script when any
folder starts to fill. Mirror them to the Mac desktop perhaps, and
have an Applescript on the mirroring folder? Just thinking.
You should be able to use file sharing to mount the PC’s folder on
your Mac and use Folder Actions to trigger scripts when people add new
files. Alternatively, in case you hadn’t considered this: You could
share a folder on your Mac and mount it on the PC and arrange to have
the files placed into that folder.
If you can’t use file sharing, then, yeah, I guess you’ll need to
arrange to periodically copy the contents onto a Mac.
I need to check the folders periodically and process the completed
files, then empty the folder (that's easy) but how do I know when a
particular folder has completed the entire upload?
That’s an issue you need to address no matter how you access the files
or how you cause the actions to be triggered, since files may appear
before they’ve been completely copied. What we recommend is that when
you notice a new file, poll its modification date periodically until
it stops changing. If you don’t expect the file transfers to stall for
more than a second or two at a time, for example, you could wait until
the modification date has not changed for, say, ten seconds. Salt to
taste.
You’ll need to do this even if you use Folder Actions with a shared
folder on a Mac, since new files may appear before the remote computer
has finished copying it to the shared folder.
Tip #1: When you process the contents of a “drop folder” (whether or
not you use Folder Actions), first move the new files to another
location, then process them. Otherwise, you’ll struggle to avoid
processing files more than once. If you end up copying files from the
PC periodically, also arrange to move or delete them from the original
folder on the PC if possible.
--
Chris Page
The other, other AppleScript Chris
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden