Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!vrdxhq!BASKIN!peter From: peter@BASKIN.UUCP (Peter Klosky) Newsgroups: net.unix Subject: Re: Anything like getpwent() for inodes? Message-ID: <117@BASKIN.UUCP> Date: Wed, 22-Oct-86 10:14:57 EDT Article-I.D.: BASKIN.117 Posted: Wed Oct 22 10:14:57 1986 Date-Received: Thu, 23-Oct-86 02:42:11 EDT Organization: Digital Analysis Corporation Lines: 30 >>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.