On 06 Oct 2010, at 09:41, Michael Van Canneyt wrote:

This is always true on Unix, the only way to make sure is to have the kernel create the temporary name and file for you. Unix - to my knowledge - does not have a way to create and lock a file in one atomic operation; There are
always 2 operations involved, and so anything can happen between the 2
calls.

You can at least open a file with O_CREAT|O_EXCL|O_NOFOLLOW to make sure that it does not yet exist at the point that you create it (and that it's not a symlink either).


Jonas
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to