On Sun, Jul 18, 2004 at 08:20:25PM -0700, David Storrs wrote:
> Race condition: what if something deletes the file between the moment
> that perl closes the file and the moment that it re-opens it?  Is
> there a cross-platform way to do an atomic reopen?

No.

To the best of my knowledge there isn't a way on Unix to reopen the same
file descriptor read-write using an existing read-only file descriptor.
Therefore there can't be a cross-platform way to do it, as it's not even
possible everywhere.

You can't store the filename of the file you originally opened, as someone
is free to move it and replace it with a symlink to a critical system file,
to try 0wn your system.


Opening needs to be done once at open time.

Nicholas Clark

Reply via email to