Re: folder vs directory
On 1/11/2010 4:37 PM, RedGrittyBrick wrote:
Roedy Green wrote:
Is there any difference between a folder and a directory? I notice
Windows people using both the terms folder and directory, where
formerly only Mac types talked of folders.
I saw some JPSoft docs that suggested directories are actual
directories on hard disk, and folders also include virtual directories
(I forget what Linux folk call them.) It when you have a directory
entry that points to files that live in some other directory.
I have also heard the terms "symbolic link", and "junction". I would
like to sort out the precise meanings of these words for the Java
glossary.
I'm pretty sure that folder is a more recent term for directory. I don't
think there's any difference. From what I recall, the term folder
arrived when the visual metaphor of a folder arrived with the Xerox and
(later) Apple GUIs.
In Unix a symbolic link is a directory entry that points to another. It
is one way of having multiple names point to the same thing in the
filesystem (directories, files, named pipes, devices ...)
IIRC a symbolic link is implemented as a file that contains the path to
another file (etc).
An ordinary link (AKA hard-link) is a special entry in a directory, this
restricts hard-links from crossing file-system joins. Symbolic links can
point across file-system boundaries.
Pretty much, except there's nothing "special" about a hard
link. All "real" directory entries are hard links (a name plus
a locator, typically an inode number), and none is in any way
different from the others.
The reason hard links can't cross file system boundaries is
that the locator portion has meaning only within its own file
system. A directory entry is something like ["theFile" -> 12345]
where the 12345 is the unique-within-file-system identifier for
the target. Some other file system, also mounted at the same
time, might well contain its own 12345 object unrelated to the
12345 in the first file system.
A symbolic link, as you say, is a file containing the path
to another file (notionally, anyhow: some shortcuts may be used).
The system looks at (local) object 12345 and discovers that it's
a symlink rather than a real file, so it reads the symlink and
looks the content up as if the content had been provided in the
first place, perhaps then finding object 54321. This process
repeats until the target is found, the target is found to be
missing, or a sanity limit is reached (mostly to guard against
link loops).
--
Eric Sosman
esosman@ieee-dot-org.invalid