From owner-freebsd-hackers Mon Apr 8 18:32:02 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id SAA19353 for hackers-outgoing; Mon, 8 Apr 1996 18:32:02 -0700 (PDT) Received: from palmer.demon.co.uk (palmer.demon.co.uk [158.152.50.150]) by freefall.freebsd.org (8.7.3/8.7.3) with ESMTP id SAA19324 for ; Mon, 8 Apr 1996 18:31:57 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by palmer.demon.co.uk (sendmail/PALMER-1) with SMTP id CAA01498 ; Tue, 9 Apr 1996 02:30:27 +0100 (BST) To: Richard Toren cc: hackers@FreeBSD.ORG From: "Gary Palmer" Subject: Re: popd.1.gz == csh.1.gz In-reply-to: Your message of "Mon, 08 Apr 1996 21:18:14 EDT." Date: Tue, 09 Apr 1996 02:30:27 +0100 Message-ID: <1496.829013427@palmer.demon.co.uk> Sender: owner-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk Richard Toren wrote in message ID : > 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...