Is it possible to have file removed upon process exit?

Garrett Cooper gcooper at FreeBSD.org
Mon Nov 29 04:43:25 UTC 2010


On Thu, Nov 25, 2010 at 12:14 PM, Xin LI <delphij at delphij.net> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
> Hi,
>
> One pretty common way of having an i-node of a file removed when process
> exit is to unlink() it while holding a descriptor of the file.  This
> approach, however, have a side effect that other processes would not be
> able to access the file via its name.
>
> For certain applications it is sometimes desirable to (e.g. for unix
> domain sockets) have file removed when the process quit, regardless
> whether the process is quit cleanly.  Is there a clean way to do this?

    Does it have to be nameless and/or unique?
Thanks,
-Garrett


More information about the freebsd-hackers mailing list