[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: emacsserver unstable?

From: Peter Dyballa
Subject: Re: emacsserver unstable?
Date: Wed, 25 Jul 2007 00:47:17 +0200

Am 25.07.2007 um 00:01 schrieb Sven Bretfeld:

What, then, is a hardlink?

In MS-DOS it's a cross-referenced file => damaged file system.

In a UNIX file system (ufs, or BSD Fast File System) a file can be one or a whole series of blocks on a disk in one file system. These can be addressed from one single "inode" (member of a directory structure) or more than one inode. On the same volume/partition/slice one file can be referenced from more than one directory, i.e. it seems to exist more than once. There is no original. The ls command shows a link count (3 in this example), and also an inode number (9099707):

        9099707 -rw-r--r--   3 pete  admin  123 25 Jul 00:17 drei
        9099707 -rw-r--r--   3 pete  admin  123 25 Jul 00:17 eins
        9099707 -rw-r--r--   3 pete  admin  123 25 Jul 00:17 zwei

No hard link consumes any disk space. It is restricted to the same file system. When you need a link to a file in another file system, it has to be a symbolic link. This one is kind of a regular file which passes every access to the file it points to. A sym-link costs as many bytes disk space as the pointer is long (plus the inode entry):

9099811 lrwxr-xr-x 1 pete admin 72 25 Jul 00:17 sym-link -> / usr/local/texlive/2007/texmf-dist/fonts/type1/public/archaic/linb10.pfb pete 165 /\ echo -n /usr/local/texlive/2007/texmf-dist/fonts/type1/ public/archaic/linb10.pfb | wc -c

Sym-links can also point to files on another computer. The target to which a sym-link points does not necessarily need to exist. When you remove a sym-link, only the sym-link file is removed (the target can continue to exist or not-exist as before). When you remove (or unlink) a file with a (hard) link count of 1, some disk space is freed and the last link to the block(s) that built the disk space of a file, is wiped out, data is lost, the file gone.

Question: what happens when you create a hard link to a symbolic link that has its target a) in the same file system, b) in another file system?



"If builders built buildings the way programmers write programs, then the first woodpecker that came along would destroy civilization."
                                 -- Weinberg's Second Law

reply via email to

[Prev in Thread] Current Thread [Next in Thread]