unlink safe before close?

John Chambers jc at minya.UUCP
Tue May 16 13:13:46 AEST 1989


In article <910 at mks.UUCP>, rand at mks.UUCP (Randall Howard) writes:
> Of course any SVID/POSIX compliant system where unlink before close
> is dangerous is just plain buggy.  However, in the real world, systems
> like MS-DOS and OS/2 corrupt the file system or give errors, respectively
> in this case.  As a result, and in the interests of maximal portability
> it is always a good idea to close files before unlinking.

Well, nobody has pointed it out, so I guess the duty falls on me (;-) to
add Sun's NFS to the list of file systems where this doesn't work.  But
then, Sun doesn't claim that NFS is SVID- or BSD-compliant, even when used 
on a set of Sun workstations.

This one I learned the hard way.  You wouldn't believe how long it can
take to track down a bug caused by a "feature" like this that *usually*
works.  Well, maybe you would.  This is comp.unix.wizards, after all.


-- 
John Chambers <{adelie,ima,mit-eddie}!minya!{jc,root}> (617/484-6393)

[Any errors in the above are due to failures in the logic of the keyboard,
not in the fingers that did the typing.]



More information about the Comp.unix.wizards mailing list