Files & Directories Flashcards
What is the purpose of file naming in a file system?
The purpose of file naming is to provide a way for users to identify and access files stored on the disk.
What are some characteristics of file names in current operating systems?
Current operating systems typically allow file names to consist of one to eight letters, digits, and special characters. Some file systems support longer names, up to 255 characters.
What are file extensions, and how are they used in different operating systems?
File extensions are a part of file names that come after a period and indicate something about the file.
What are regular files and directories in a file system?
Regular files are files that contain user information, such as text or binary data.
Directories are system files used to maintain the structure of the file system.
What is the difference between ASCII files and binary files?
ASCII files consist of lines of text and can be displayed, printed, and edited with text editors.
Binary files, on the other hand, do not follow the ASCII encoding and often have internal structures known to programs that use them.
Provide examples of binary files mentioned in the text.
a) Executable binary file with sections like header, text, data, relocation bits, and symbol table.
b) Archive file consisting of compiled but not linked library procedures with module headers.
What are some potential issues with strongly typed files?
Strongly typed files, where file types are determined by the operating system based on their extensions, can cause problems when users try to perform unexpected actions. For example, if a user transforms a C program and saves it with a different extension, the system may reject it when trying to compile because it doesn’t match the expected file type.
File attributes
refer to additional information associated with a file, apart from its name and data.
They include:
- Protection: Specifies who can access the file and in what way. It defines the file’s permissions and security settings.
- Password: In systems that require password-based access, this attribute indicates the password needed to access the file.
- Creator: Identifies the user who created the file.
Owner: Represents the current owner of the file.
What is the purpose of directories in a file system?
Directories are used to organize and group related files together in a hierarchical structure.
What is the difference between a single-level directory system and a hierarchical directory system?
In a single-level directory system, all files are stored in a single directory, while in a hierarchical directory system, files are organized in a tree-like structure with nested directories.
Why is a hierarchical directory system preferred for managing a large number of files
allows for better organization and management of files by grouping them into directories, making it easier to locate specific files among a large number of them.
What is the difference between an absolute path and a relative path?
An absolute path specifies the complete path to a file or directory from the root directory, while a relative path specifies the path to a file or directory relative to the current working directory.
What are the advantages and disadvantages of symbolic links compared to hard links?
Symbolic Link:
- provide flexibility and can point to files or directories on different disks or even remote systems.
- less efficient and require additional lookups to follow the link.
Hard Link:
- provide a direct link to the file’s data and are more efficient
- cannot cross file system boundaries.
What are some common directory operations?
creating and deleting directories, opening and closing directories for reading, reading the contents of a directory, renaming directories, creating hard links, and removing directory entries.
How are dot (.) and dotdot (..) used in directory systems?
Dot (.) represents the current directory, while dotdot (..) represents the parent directory.