inodes

Larry Lippman larry at kitty.UUCP
Thu Oct 23 11:40:51 AEST 1986


In article <47 at andromeda.UUCP>, marco at andromeda.UUCP (the wharf rat) writes:
> 	Now, my next question:  Is there any way to "get" an i-node into a C 
> program, the way getpwent gets passwd entries ?  Do I really have to
> open the device file and look for the i-list ?  

	Use stat(2) if you have a pathname for a file, or fstat(2) if you
have a file descriptor resulting from another system call which has already
opened the file.
	Both stat(2) and fstat(2) return a pointer to a stucture (found in
/usr/include/sys/stat.h), in which the variable st_ino is the inode number.
	The above applies to System V; but I can't speak for Beserkeley.

==>  Larry Lippman @ Recognition Research Corp., Clarence, New York
==>  UUCP:  {allegra|decvax|rocksanne|rocksvax|watmath}!sunybcs!kitty!larry
==>  VOICE: 716/688-1231           {hplabs|ihnp4|seismo|utzoo}!/
==>  FAX:   716/741-9635 {G1,G2,G3}      "Have you hugged your cat today?" 



More information about the Comp.unix mailing list