Namespace and File naming conventions

File system

  1. the most visible aspect of an operating system
  2. provides the mechanism to store and access data and programs through
    • a collection of files, each storing related data, and
    • a directory structure, to organize and provide information about all the files in the system.
  3. live on storage devices.
  4. is the method that the operating system uses for organizing and storing information on the system, including processes, serial ports, and inter-process communication channels (mapped into the file system namespace)
  5. has four main components:
    • a namespace: a way of naming things and organizing them in a hierarchy;
    • an API: a set of system calls for navigating and manipulating objects;
    • a security model: a scheme for protecting, hiding, and sharing things;
    • an implementation: software that ties the logical model to actual hardware.

Namespace

Namespace – a way of naming things

  • Namespace supports two-part file names, with the two parts separated by a period
  • file extension usually indicates something about the file
  • Note that space (blank) is used as delimiter to tokenize commands, therefore it is not used to name file and directory.

Namespace – a way of organizing things

The key to all operations is that the data has some kind of structure.

  • Directory: a file that acts as a holder for other files and directories.
  • File: a collection of data that is stored on a disk and that can be manipulated as a single unit by its name.
  • Directory tree: includes a directory and all of its contents and its sub-directories.
  • Parent directory: a file that contains another directory.

File naming conventions

  1. Do not use spaces in file and directory (folder) names
  2. Use short filenames (seven-nine characters) that have meaning
  3. Use lower case, but camel casing is OK; be consistent.
  4. Use alphanumeric characters only: letters and numbers
  5. Avoid special characters, such as * ! # $ % ^ & = + ; ,
  6. Use underscores or hyphens; be consistent.
  7. Use either .html or .htm (pick one nd stick to it, do not mix); preferred (newer) .html
  8. All filenames end in dot-three-letter, some dot-four-letter, extension.