Incomputing,adirectoryis afile systemcataloging structure which contains references to othercomputer files,and possibly other directories. On many computers, directories are known asfolders,ordrawers,[1]analogousto aworkbenchor the traditional officefiling cabinet.The name derives from books like atelephone directorythat 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 ahierarchical file system(that is, one in which files and directories are organized in a manner that resembles atree), a directory contained inside another directory is called asubdirectory.The termsparentandchildare 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 therootdirectory.
Thefreedesktop.orgmedia type for directories within manyUnix-likesystems – including but not limited to systems usingGNOME,KDE Plasma 5,orROX Desktopas the desktop environment – is "inode/directory".[2]This is not anIANA registered media type.
Overview
editHistorically, and even on some modernembedded 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 apath.
In manyoperating systems,programs have an associatedworking directoryin 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 auser'saccess only to theirhome directoryor project directory, thus isolating their activities from all other users. In early versions of Unix the root directory was the home directory of theroot user,but modern Unix usually uses another directory such as/rootfor this purpose.
In keeping withUnix 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 andsystem callsthat return records, not a byte-stream.[4]
Folder metaphor
editThe namefolder,presenting an analogy to thefile folderused in offices, and used in a hierarchical file system design for theElectronic Recording Machine, Accounting(ERMA) Mark 1 published in 1958[5]as well as byXerox Star,[6]is used in almost all modernoperating systems' desktop environments. Folders are often depicted withiconswhich visually resemble physical file folders.
There is a difference between adirectory,which is afile systemconcept, and thegraphical user interfacemetaphor that is used to represent it (afolder).[original research?]For example,Microsoft Windowsuses the concept ofspecial foldersto help present the contents of the computer to the user in a fairly consistent way that frees the user from having to deal with absolute directory paths, which can vary between versions of Windows, and between individual installations. Many operating systems also have the concept of "smart folders" orvirtual foldersthat reflect the results of a file system search or other operation. These folders do not represent a directory in the file hierarchy. Manyemail clientsallow the creation of folders to organize email. These folders have no corresponding representation in the filesystem structure.
If one is referring to acontainer of documents,the termfolderis more appropriate.[citation needed]The termdirectoryrefers to the way a structured list of document files and folders are stored on the computer. The distinction can be due to the way a directory is accessed; on Unix systems,/usr/bin/is usually referred to as a directory when viewed in acommand lineconsole,but if accessed through a graphicalfile manager,users may sometimes call it a folder.
Lookup cache
editThis sectionneeds expansion.You can help byadding to it.(December 2013) |
Operating systems that support hierarchical filesystems (practically all modern ones) implement a form ofcachingtoRAMof recentpathlookups. In theUnixworld, this is usually calledDirectory Name Lookup Cache(DNLC), although it is calleddcacheonLinux.[7]
For local filesystems, DNLC entries normally expire only under pressure from other more recent entries. Fornetwork file systemsacoherence mechanismis necessary to ensure that entries have not been invalidated by other clients.[7]
See also
editReferences
edit- ^"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.
- ^Leonard, Thomas (2018-10-02)."Shared MIME-info Database".X Desktop Group.Non-regular files.Retrieved2023-03-13.
- ^"Everything is a File".Behavior Genetics Association.c. 2002. Archived fromthe originalon March 10, 2012.RetrievedApril 30,2021.
- ^"readdir(3) — Linux manual page".The Linux man-pages project. 2021-03-22.RetrievedNovember 27,2022.
- ^Barnard III, G. A.; Fein, L. (1958)."Organization and Retrieval of Records Generated in a Large-Scale Engineering Project".Proceedings of the Eastern Joint Computer Conference:59–63.doi:10.1109/AFIPS.1958.75.
- ^""Xerox Star User Interface (1982)"".YouTube.28 August 2009.Archivedfrom the original on 2021-12-21.Retrieved19 November2014.
- ^ab"Close-To-Open Cache Consistency in the Linux NFS Client".Citi.umich.edu.Retrieved19 November2014.
External links
edit- Definition of directoryby The Linux Information Project (LINFO)