in reply to Re: locate path to a file from inode number
in thread locate path to a file from inode number

One of those questions that I've always wondered about but never been bothered enough to research: is there a way to create a new link to such a file that exists in the inode table but has no other links, using only the inode number? Not that I can supply any practical use - I guess I'm just curious for purposes of orthogonality.

Makeshifts last the longest.

  • Comment on Re^2: locate path to a file from inode number

Replies are listed 'Best First'.
Re: locate path to a file from inode number
by Abigail-II (Bishop) on Nov 11, 2002 at 15:39 UTC
    This is what fsck does - it'll link unreferenced inodes to lost+found.

    Abigail

      I am aware of that. What I was wondering is whether there is a system call or something of the like available to a regular program, so that one could create a link to a file given merely an open handle to it. In other words, is there any way to re-link a temporary file that has no links before it vanishes?

      Makeshifts last the longest.

        It's probably unlikely that there's a system call for that, as it will be a file system specific operation. If such a tool would be written, it should use the character device to access the filesystem, and used very very carefully.

        And of course, it would require root privilidges. Not that I'm aware such a program exists.

        Abigail