> here's the situation:
> i have a file, and i want to open it only when no other process is
> writing to it. but i don't have control over the possibly writing
> process, so i can't do advisory or mandatory locking.
> basically, i want to treat a file received by scp only after the
> download is complete.
>
> of course i can write the file to /tmp or somewhere and then mv it to
> its destination directory when it's complete. but i was wondering if
> there's a more elegant soultion.

If the temporary directory and the destination directory are not
on the same filesystem then the mv won't be atomic.  So for this to work
you need to process the file after mv terminates, or you have the same
problem all over again.

Which begs the question, if you can mv the file after it's complete, why
not just do your processing instead?


=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to