Files & Directories Flashcards

1
Q

What is the purpose of file naming in a file system?

A

The purpose of file naming is to provide a way for users to identify and access files stored on the disk.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are some characteristics of file names in current operating systems?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are file extensions, and how are they used in different operating systems?

A

File extensions are a part of file names that come after a period and indicate something about the file.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are regular files and directories in a file system?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is the difference between ASCII files and binary files?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Provide examples of binary files mentioned in the text.

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are some potential issues with strongly typed files?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

File attributes

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the purpose of directories in a file system?

A

Directories are used to organize and group related files together in a hierarchical structure.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is the difference between a single-level directory system and a hierarchical directory system?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Why is a hierarchical directory system preferred for managing a large number of files

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is the difference between an absolute path and a relative path?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What are the advantages and disadvantages of symbolic links compared to hard links?

A

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.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What are some common directory operations?

A

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 well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

How are dot (.) and dotdot (..) used in directory systems?

A

Dot (.) represents the current directory, while dotdot (..) represents the parent directory.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What system calls are commonly used for managing directories?

A

create, delete, opendir, closedir, readdir, rename, link, unlink