Directory (computing)






Screenshot of a Microsoft Windows Command Prompt window showing a directory listing.


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.


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.




Contents






  • 1 Overview


    • 1.1 Folder metaphor




  • 2 Lookup cache


  • 3 See also


  • 4 References


  • 5 External links





Overview




Diagram of a hierarchical directory tree. The root directory is here called "MFD", for Master File Directory.


Historically, and even on some modern embedded systems, the file systems either had no support for directories at all, or only had 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 user's access to only their home directory or project directory, thus isolating their activities from all other users. In early versions of Unix the root directory was the home directory of the root user, but modern Unix usually uses another directory such as /root for this purpose.


In keeping with Unix philosophy, Unix systems treat directories as a type of file.[2]



Folder metaphor




Sample folder icon (from KDE).


The name folder, presenting an analogy to the file folder used in offices, and used in a hierarchical file system design for the Electronic Recording Machine, Accounting (ERMA) Mark 1 published in 1958[3] as well as by Xerox Star,[4] is used in almost all modern operating systems' desktop environments. Folders are often depicted with icons which visually resemble physical file folders.


There is a difference between a directory, which is a file system concept, and the graphical user interface metaphor that is used to represent it (a folder). For example, Microsoft Windows uses the concept of special folders to 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" or virtual folders that reflect the results of a file system search or other operation. These folders do not represent a directory in the file hierarchy. Many email clients allow the creation of folders to organize email. These folders have no corresponding representation in the filesystem structure.


In computing, a directory and a folder are the same thing.[5][6][7]


If one is referring to a container of documents, the term folder is more appropriate. The term directory refers to the way a structured list of document files and folders is 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 a command line console, but if accessed through a graphical file manager, users may sometimes call it a folder.



Lookup cache


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.[8]


For local filesystems, DNLC entries normally expire only under pressure from other more recent entries. For network file systems a coherence mechanism is necessary to ensure that entries have not been invalidated by other clients.[8]



See also











References





  1. ^ "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..mw-parser-output cite.citation{font-style:inherit}.mw-parser-output q{quotes:"""""""'""'"}.mw-parser-output code.cs1-code{color:inherit;background:inherit;border:inherit;padding:inherit}.mw-parser-output .cs1-lock-free a{background:url("//upload.wikimedia.org/wikipedia/commons/thumb/6/65/Lock-green.svg/9px-Lock-green.svg.png")no-repeat;background-position:right .1em center}.mw-parser-output .cs1-lock-limited a,.mw-parser-output .cs1-lock-registration a{background:url("//upload.wikimedia.org/wikipedia/commons/thumb/d/d6/Lock-gray-alt-2.svg/9px-Lock-gray-alt-2.svg.png")no-repeat;background-position:right .1em center}.mw-parser-output .cs1-lock-subscription a{background:url("//upload.wikimedia.org/wikipedia/commons/thumb/a/aa/Lock-red-alt-2.svg/9px-Lock-red-alt-2.svg.png")no-repeat;background-position:right .1em center}.mw-parser-output .cs1-subscription,.mw-parser-output .cs1-registration{color:#555}.mw-parser-output .cs1-subscription span,.mw-parser-output .cs1-registration span{border-bottom:1px dotted;cursor:help}.mw-parser-output .cs1-hidden-error{display:none;font-size:100%}.mw-parser-output .cs1-visible-error{font-size:100%}.mw-parser-output .cs1-subscription,.mw-parser-output .cs1-registration,.mw-parser-output .cs1-format{font-size:95%}.mw-parser-output .cs1-kern-left,.mw-parser-output .cs1-kern-wl-left{padding-left:0.2em}.mw-parser-output .cs1-kern-right,.mw-parser-output .cs1-kern-wl-right{padding-right:0.2em}


  2. ^ [1] Archived March 10, 2012, at the Wayback Machine.


  3. ^ 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.


  4. ^ ""Xerox Star User Interface (1982)"". YouTube. Retrieved 19 November 2014.


  5. ^
    Lou Manna.
    "Digital Photography for Teens".
    2007.
    p. 98.



  6. ^
    Jon Duckett.
    "Beginning HTML, XHTML, CSS, and JavaScript".
    2011.
    p. 61.



  7. ^
    Computer Hope.
    "What is the difference between a directory and folder?".
    2008.



  8. ^ ab "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)










這個網誌中的熱門文章

12.7 cm/40 Type 89 naval gun

Rikitea

University of Vienna