in reply to Re: How to represent the filesystem in DS?
in thread How to represent the filesystem in DS?
Some notes on names vs. IDs:
Using the absolute path to identify a file is what happens e.g. with a FAT filesystem.
Many filesystems that have a Unix history (Unix File System, MINIX file system, Extended file system family, ...) identify each file by a numeric ID. (See also inode.) Directories are just special files that associate names with file IDs.
One quite obvious difference is that the file ID does not change when you move or rename a file.
Another major difference of the numeric ID is that files can have zero or more names. Having no name for a file is useful for private temporary files. There is simply no way to access them except by having an open file handle. Having more than one name for a file is generally known as hardlink, and allows to refer the same file from different directories using different names. This is used e.g. by BusyBox.
On FAT filesystems, having more than one name for the same file is generally considered a filesystem error.
(Note that Windows Long filename support a.k.a. VFAT adds an optional alias for each part of the path. Both the short and long filenames still have to be unique. Both can be used interchangeably for each part of the path.)
Alexander
|
|---|