Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 09 Apr 1996 02:30:27 +0100
From:      "Gary Palmer" <gpalmer@FreeBSD.ORG>
To:        Richard Toren <rpt@miles.sso.loral.com>
Cc:        hackers@FreeBSD.ORG
Subject:   Re: popd.1.gz == csh.1.gz 
Message-ID:  <1496.829013427@palmer.demon.co.uk>
In-Reply-To: Your message of "Mon, 08 Apr 1996 21:18:14 EDT." <Pine.SUN.3.91.960408211411.8270A-100000@miles> 

next in thread | previous in thread | raw e-mail | index | archive | help
Richard Toren wrote in message ID
<Pine.SUN.3.91.960408211411.8270A-100000@miles>:
> Gary,
>   I realize pop (and popd) are csh commands. But going beyond just doing 
> a man, the two files in /cdrom/usr/share/man/man1 are the exact same 
> size, and  'cmp csh.1.gz popd.1.gz' is completly silent. in my book that 
> probably means their contents are the same ???

Probably because they are linked together, so that they share the same
diskspace for multiple directory entries?

gary@palmer:/usr/share/man/man1> ls -ailgo csh.1.gz popd.1.gz popd.1.gz
57954 -r--r--r--  16 bin  bin  - 23265 Mar 28 01:18 csh.1.gz
57954 -r--r--r--  16 bin  bin  - 23265 Mar 28 01:18 popd.1.gz
57954 -r--r--r--  16 bin  bin  - 23265 Mar 28 01:18 popd.1.gz

^^^^^

That first field is the i-node number. It's a bit difficult to explain
if you don't understand the FFS layout. Basically, the directory entry
just points to a data structure stored on the disk called an `inode',
and it references it via a number (as the inode structures are stored
in tables). The inode structure actually contains all the file
meta-data, like size, ownership, etc, and also where on the disk to
find the actual file contents.  So multiple directory entries can
reference the same inode, and hence the same file can appear multiple
times on the disk whilst only occupying one set of disk space.

(the `16' in the 3rd field in the abouve ls is actually the reference
 count, which is how many times that the same inode is pointed to by
 directory entries.)

So having the same man page in multiple different files doesn't mean
taking up an un-necessary ammount of disk space.

Gary

P.S. Sorry if the above is not clear. The actual technicalities of the
     FFS filesystem are a lot more difficult...



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1496.829013427>