How can unlinking be postponed?
Doug Gwyn <gwyn>
gwyn at brl-tgr.ARPA
Sun Sep 8 15:58:24 AEST 1985
> ... Does the directory entry disappear immediately but not
> the i-node and its associated disk space?
Exactly.
> If that's so, shouldn't any
> syscall except read return an error value since the process making that
> call is under the reasonable impression that the file's still there when
> it isn't?
? Any meaningful system call (e.g., lseek, stat) still works. Only
an attempt to locate the unlinked directory entry will fail. There
is no reason to put special-case code for this into the kernel.
> Is there no way for a file to be removed upon a process' exit?
You can use onexit() if your system has it (it probably doesn't).
Any file made by tmpfile(3) will vanish upon process termination.
More information about the Comp.unix.wizards
mailing list