If you keep a lot of mail in a lot of folders, you may want to file the same message in more than one folder. Because MH stores its messages in separate UNIX files, it can take advantage of a UNIX feature called a link. (To keep everything simple, Figure Important parts of a UNIX filesystem doesn't show them. But the Figure Two linked messages does.)
Even when you have several links to a file, there's only one copy of the file stored on the computer's disk -- that file has several names. If you add another link (another name), the new link doesn't take any more disk space. (The directory file which holds the entry for the link will use a few characters to store the link itself, but that's usually insignificant.)
When you use the MH refile -link command, it links a message from one folder into another. In other words, it creates a second name for the same file without removing the original name.
A file can have as many links (as many names), in as many directories, as you want to give it. UNIX just relates the name to the file's i-number. In fact, a directory is basically just a list of filenames and their i-numbers.
The next Figure shows an example of a message with two links. One link is in the friends folder: message number 5. The other link is in the meals folder: message number 1. Both links have the same i-number (6241), so they both "point to" the same file on the disk. (If you know about "pointers" in programming, a link is a lot like a pointer to a memory location.)
Links can't span filesystems. Many newer UNIX filesystems have symbolic links. Symbolic links can span filesystems, but they take disk space to store.
[Table of Contents] [Index] [Previous: Special Files for exmh] [Next: Caution About MH Files and Newline Characters]
This file is from the third edition of the book MH & xmh: Email for Users & Programmers, ISBN 1-56592-093-7, by Jerry Peek. Copyright © 1991, 1992, 1995 by O'Reilly & Associates, Inc. This file is freely-available; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation. For more information, see the file copying.htm.
Suggestions are welcome: Jerry Peek <jpeek@jpeek.com>