
In computing, a directory is a tệp tin system cataloging structure which contains references đồ sộ other computer files, and possibly other directories. On many computers, directories are known as folders, or drawers,[1] analogous đồ sộ a workbench or the traditional office filing cabinet. The name derives from books lượt thích 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 tệp tin 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 đồ sộ 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 truyền thông type for directories within many Unix systems – including but not limited đồ sộ systems using GNOME, KDE Plasma 5, or ROX Desktop as the desktop environment – is "inode/directory".[2] This is not an IANA registered truyền thông type.
Overview[edit]

Historically, and even on some modern embedded systems, the tệp tin systems either had no tư vấn 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 đồ sộ 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, tệp tin names accessed by the program are assumed đồ sộ reside within this directory if the tệp tin names are not specified with an explicit directory name.
Some operating systems restrict a user's access only đồ sộ their home page directory or project directory, thus isolating their activities from all other users. In early versions of Unix the root directory was the home page 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 tệp tin.[3] Caveats include not being able đồ sộ write đồ sộ a directory tệp tin except indirectly by creating, renaming and removing tệp tin system objects in the directory and only being able đồ sộ read from a directory tệp tin using directory-specific library routines and system calls that return records, not a byte-stream.[4]
Xem thêm: turn for là gì
Folder metaphor[edit]

The name folder, presenting an analogy đồ sộ the tệp tin thư mục used in offices, and used in a hierarchical tệp tin system design for the Electronic Recording Machine, Accounting (ERMA) Mark 1 published in 1958[5] as well as by Xerox Star,[6] is used in almost all modern operating systems' desktop environments. Folders are often depicted with icons which visually resemble physical tệp tin folders.
There is a difference between a directory, which is a tệp tin system concept, and the graphical user interface metaphor that is used đồ sộ represent it (a folder).[original research?] For example, Microsoft Windows uses the concept of special folders đồ sộ help present the contents of the computer đồ sộ the user in a fairly consistent way that frees the user from having đồ sộ khuyến mãi 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 tệp tin system tìm kiếm or other operation. These folders tự not represent a directory in the tệp tin hierarchy. Many gmail clients allow the creation of folders đồ sộ organize gmail. These folders have no corresponding representation in the filesystem structure.
If one is referring đồ sộ a container of documents, the term folder is more appropriate.[citation needed] The term directory refers đồ sộ the way a structured list of document files and folders are stored on the computer. The distinction can be due đồ sộ the way a directory is accessed; on Unix systems, /usr/bin/ is usually referred đồ sộ as a directory when viewed in a command line console, but if accessed through a graphical tệp tin manager, users may sometimes Hotline it a thư mục.
Lookup cache[edit]
![]() | This section needs expansion. You can help by adding đồ sộ it. (December 2013) |
Operating systems that tư vấn hierarchical filesystems (practically all modern ones) implement a size of caching đồ sộ 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 network tệp tin systems a coherence mechanism is necessary đồ sộ ensure that entries have not been invalidated by other clients.[7]
Xem thêm: piglet fat là gì
See also[edit]
- File folder
References[edit]
External links[edit]
- Definition of directory by The Linux Information Project (LINFO)
Bình luận