unlink safe before close?

Leslie Mikesell les at chinet.chi.il.us
Tue May 9 14:10:07 AEST 1989


In article <8201 at phoenix.Princeton.EDU> bernsten at phoenix.Princeton.EDU (Dan Bernstein) writes:
>  [is it nonportable to unlink an fd and still use it?]

>According to various UNIX standards and according to the internal
>workings of the ``standard'' kernel routines (see, e.g., Bach),
>it is perfectly safe. A file is removed when it is fully unlink()ed
>*and* fully close()d; link() and unlink() do not affect file behavior
>after an open().

Note that this does not apply to NFS file systems.  The "stateless"
nature of the protocol precludes the server from knowing that a
client thinks it still has the file open.


Les Mikesell



More information about the Comp.unix.wizards mailing list