in reply to Re^4: locking over the network (rename)
in thread locking over the network
You are writing the file to one file system and then "renaming" it to a different file system? Why? That's rather silly. Renaming to a different file system requires that the contents be copied, which means races leading to partial content. If you need to do that, then I'd copy the file to the new file system under a temporary name (even if you use /bin/mv to do the copying) and then atomically rename from the temporary name (which the receiver should know to ignore) to the real name (which might involve two different directories on the final file system).
You haven't even bothered to read any Unix man pages for rename? Did you want an engraved invitation? They even answer your question about NFS.
Note that Perl's rename is atomic on Win32 including across Samba. No, I don't have links that say this ready to hand to you. You might have to do some research.
- tye
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: locking over the network (rename)
by rovf (Priest) on Feb 01, 2011 at 15:52 UTC | |
by Anonymous Monk on Feb 02, 2011 at 02:59 UTC | |
|
Re^6: locking over the network (rename)
by rowdog (Curate) on Feb 02, 2011 at 02:17 UTC |