Re: Moving large PDF files with Applescript
Re: Moving large PDF files with Applescript
- Subject: Re: Moving large PDF files with Applescript
- From: "John C. Welch" <email@hidden>
- Date: Wed, 01 Apr 2009 13:47:04 -0400
- Thread-topic: Moving large PDF files with Applescript
On 4/1/09 12:51 PM, "David Crowe" <email@hidden> wrote:
> My experience with anything based on timing is that it's inefficient
> and subject to working really well for some period of time and then
> failing miserably.
That's not been my experience.
>
> If the transfer code bombs before it write the .end file it probably
> didn't finish transferring the main PDF file. In which case the
> timing version will move it as if it was a completed file, but the
> version based on transmission of a second file with fail-safe,
> leaving the partial file in place. In the unlikely event that only
> the transmission of the second tiny file fails, the original file
> will remain in place to be manually moved. Presumably in this unusual
> case someone would open up the file to make sure it was fully
> transferred.
That's assuming the only way to use the timing loop is to check for
increases. The obvious solution here is to compare the current size of the
written file to the known size of the complete file. Once the two are the
same, obviously, the file is done, and you can move on. If not, you wait,
and after a certain delay, notify someone that something went wrong. The
advantage of this method is that you don't need to delay anything, you can
check as often as you like as fast as you like, since network speed and
reliability aren't able to directly create a problem, other than the file
not successfully transferring, which is a problem *regardless* of method.
>
> If this is a common problem, the transfer code could check for files
> that are in the folder and older than a certain time (say 1 day, 1
> week) and then offer to delete them or move them. Or you could just
> manually clean up once in a while.
That's complicating things even more.
>
> You're right that no code is perfect, but code that obscures errors
> is not to be preferred.
Code that requires manual intervention or additional verification and
cleanup processes isn't exactly exciting either.
--
''Look, I don't want to wax philosophic, but I will say that if you're alive
you've got to flap your arms and legs, you've got to jump around a lot, for
life is the very opposite of death, and therefore you must at [the] very
least think noisy and colorfully, or you're not alive.''
- Mel Brooks
_______________________________________________
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