On Thu, 25 May 2000, Sven Burgener wrote: > > >> 108545 drwxr-xr-x 21 root root 1024 Feb 19 17:34 usr > > ... I assumed that the hard links theory of files applies to directories > in the very same way. That would mean that - if it were possible - there > are 21 [hard] links to /usr somewhere on the system. That's what puzzled
There are. The directory entry for /usr in / is one, as is the '.' entry in /usr and the '..' entries in all of the subdirectories of /usr. Find ignores all of these except the first. Other than these exceptions, no hard links to directories are allowed. > Hmm. I am not completely new to *nix, but named pipes I know nothing of. It's basically a pipe that lives in the filesystem. The man page for mknod touches on them briefly. A process can open it for writing and another can open it for reading. All the data that the first process writes is readable by the second as if it were a pipe, and none of the data is ever actually saved in the filesystem. This allows programs to communicate with each other via pipes without necessarily knowing about the process on the other end of the pipe. For example, you can use this to have a program output its logfile into a pipe, then parse it with perl, sed, or something and write the finished output into some other file, and the original program writing the logfile does not need to have any special support to do it.