in reply to Re: Re: Can you delete a file by descriptor?
in thread Can you delete a file by descriptor?

Thats pretty slick... I like it. You can get the same info from /dev/fd/n as well.
% perl -e'open($fh,"/tmp/file"); print readlink("/dev/fd/" . fileno($f +h))' /tmp/file

-Blake

Replies are listed 'Best First'.
Re: Re3: Can you delete a file by descriptor?
by theorbtwo (Prior) on Mar 15, 2002 at 15:44 UTC

    Nod. (BTW, this works because /dev/fd/ is a symlink to /proc/self/fd/, and /proc/self is (magicly) a symlink to /proc/(pid) for whatever process is following the link.


    We are using here a powerful strategy of synthesis: wishful thinking. -- The Wizard Book