[comp.sys.sun] Confused about a file with no links

jes@mbio.med.upenn.edu (Joe Smith) (07/15/90)

In trying to snoop on a process doing (apparently) nothing, I found this:

$ /usr/etc/pstat -i | awk 'NR==2 || $7 == 0'
  ILOC   IFLAG  IDEVICE   INO   MODE NLK  UID  SIZE/DEV VFLAG CNT SHC EXC TYPE
 f0b8f90    R     7,  0  1765 100600   0  131       247         1   0   0 VREG

As the 'NLK' field is supposed to be the number of links to the file (and
NLK agrees with ls for other files which I could find directory entries
for) I am curious as to what a file with no links is and what conditions
create them.

 Joe Smith
 University of Pennsylvania                    jes@mbio.med.upenn.edu
 Dept. of Biochemistry and Biophysics          (215) 898-8348
 Philadelphia, PA 19104-6059

falk@peregrine.eng.sun.com (Ed Falk) (07/19/90)

In article <9952@brazos.Rice.edu> jes@mbio.med.upenn.edu (Joe Smith) writes:

>As the 'NLK' field is supposed to be the number of links to the file (and
>NLK agrees with ls for other files which I could find directory entries
>for) I am curious as to what a file with no links is and what conditions
>create them.

Well, you could delete a file that some program has open.  It doesn't go
away until it's closed, but it has no links.  I suppose that could be it.

Many programs that create temporary files delete them right away so the
file will go away as soon as the program exits.  The advantage to this is
that if the program exits abnormally, it won't leave its temporary file
lying around.

	-ed falk, sun microsystems -- sun!falk, falk@sun.com