5

I get an inode for some logging file like '/tmp/logging'
and I want to open it via inode, NOT path.
How to do it?

2 Answers 2

7

In general you cannot do this from user-space because the system routines accept a path as an argument.

Take a look at this post.

1
  • 1
    Ah, nice find — much better than my link. OP, give this (wo)man an accept! Mar 25, 2012 at 6:44
5

Short of a brute-force search of the filesystem for the inode (ex, find / -inum $X), you can't.

See the discussion here: http://coding.derkeiler.com/Archive/Perl/comp.lang.perl.misc/2006-05/msg02223.html

1
  • 2
    IIRC not every inode needs to be listed in a directory
    – 6502
    Mar 25, 2012 at 6:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.