Anything like getpwent() for inodes?

Peter Klosky peter at BASKIN.UUCP
Thu Oct 23 00:14:57 AEST 1986


>>Is there a routine out there to read an inode?
>Yes, it's called stat().

Trying not to set a sarcastic tone, let me say it is a little
anxiety forming to find out that du() and ls() do not tell
the truth about files that have "holes" in them.  If you are on
a system that has a lot of files with this "feature," it will be
impossible to find out who is using what space in terms of systems
administration; the problem is that programs use stat() when they
should not.
One of my dearest relatives wrote a program to find out the true
file block usage of a file, hence the name for the utility, fbu().
It has been posted to net.sources in an alternate universe, but
it really should be a feature of du, kind of a "try harder" option.
It is also hard to stat a file when it is not referenced in a
directory, even though you know its inode number.
fbu() will also cat a file by inode number.
I have been trying to get this program to work on the 4.2 file
system layout, but I am confused about this new file system.  
Can anyone give me some hints about how a program to cat a file
by inode number might be written in the 4.2 world?  Does anyone have an 
inode reader that works under 4.2?  Am I really confused, and is 
the 4.2 file system layed out just like the historic file system?
I have lost my version of SuperPS, btw, and am wondering if anyone has
modified ofiles() to reveal not only the names of the files open by 
a given process, but also tell a few words about the state of
tcp/ip connections open.  Sort of like ps(), ofiles() and netstat()
merged together.  The system I am typing on now has such poor utilities
that it prints the WCHAN in non-symbolic form; a UNIX system that
can't tell between a wait() and a ttyread() makes me given to wonder.



More information about the Comp.unix mailing list