Directory (computing)
In computing, a directory is a file system cataloging structure which contains references to other computer files, and possibly other directories. On many computers, directories are known as folders, or drawers,[1] analogous to a workbench or the traditional office filing cabinet. The name derives from books like a telephone directory that lists the phone numbers of all the people living in a certain area.
Files are organized by storing related files in the same directory. In a hierarchical file system (that is, one in which files and directories are organized in a manner that resembles a tree), a directory contained inside another directory is called a subdirectory. The terms parent and child are often used to describe the relationship between a subdirectory and the directory in which it is cataloged, the latter being the parent. The top-most directory in such a filesystem, which does not have a parent of its own, is called the root directory.
The freedesktop.org media type for directories within many Unix systems – including but not limited to systems using GNOME, KDE Plasma 5, or ROX Desktop as the desktop environment – is "inode/directory".[2] This is not an IANA registered media type.
Overview
Historically, and even on some modern embedded systems, the file systems either had no support for directories at all or had only a "flat" directory structure, meaning subdirectories were not supported; there were only a group of top-level directories, each containing files. In modern systems, a directory can contain a mix of files and subdirectories.
A reference to a location in a directory system is called a path.
In many operating systems, programs have an associated working directory in which they execute. Typically, file names accessed by the program are assumed to reside within this directory if the file names are not specified with an explicit directory name.
Some operating systems restrict a
In keeping with Unix philosophy, Unix systems treat directories as a type of file.[3] Caveats include not being able to write to a directory file except indirectly by creating, renaming and removing file system objects in the directory and only being able to read from a directory file using directory-specific library routines and system calls that return records, not a byte-stream.[4]
Folder metaphor
The name folder, presenting an analogy to the
There is a difference between a directory, which is a
If one is referring to a container of documents, the term folder is more appropriate. [
Lookup cache
This section needs expansion. You can help by adding to it. (December 2013) |
Operating systems that support hierarchical filesystems (practically all modern ones) implement a form of caching to RAM of recent path lookups. In the Unix world, this is usually called Directory Name Lookup Cache (DNLC), although it is called dcache on Linux.[7]
For local filesystems, DNLC entries normally expire only under pressure from other more recent entries. For
See also
|
|
References
- ^ "Chapter 1: Tutorial". Using The AMIGA Workbench. Commodore-Amiga. July 1991. p. 46.
The path specifies the disk name, or location, and all of the drawers that lead to the specified file.
- X Desktop Group. Non-regular files. Retrieved 2023-03-13.
- ^ "Everything is a File". Behavior Genetics Association. c. 2002. Archived from the original on March 10, 2012. Retrieved April 30, 2021.
- ^ "readdir(3) — Linux manual page". The Linux man-pages project. 2021-03-22. Retrieved November 27, 2022.
- .
- ^ ""Xerox Star User Interface (1982)"". YouTube. Archived from the original on 2021-12-21. Retrieved 19 November 2014.
- ^ a b "Close-To-Open Cache Consistency in the Linux NFS Client". Citi.umich.edu. Retrieved 19 November 2014.
External links
- Definition of directory by The Linux Information Project (LINFO)