What is the difference between a directory and a folder?

前端 未结 7 2109
醉话见心
醉话见心 2021-01-30 05:56

Most people use the terms \"folder\" and \"directory\" interchangeably. From a programmer point of view, is there a difference, and if so, what is it? Does it depend on the OS,

7条回答
  •  半阙折子戏
    2021-01-30 06:37

    • Directory is a file system concept. In a GUI the directory is represented as a Folder.
    • Example 1: 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.
    • Example 2: Windows uses both Directory (in commands like mkdir, cd) and Folder (in the GUI).

    Directory: The name directory represents an analogy to the telephone directory:

    Image of a telephone directory


    Folder: The name folder represents an analogy to the file folder used in offices:

    Image of office folders


    Analogy:

    • A Folder is like a room.
    • A Directory is like a hotel keeper who knows all the rooms.

    If you want a specific folder, you use the directory. If you want a specific room you ask the hotel keeper. Source

提交回复
热议问题