File System Interface Flashcards

1
Q

Why is open() call implemented?

A

The open() call takes a file name and searches the directory, copying the directory entry into the open file table. It can also accept access mode information. It is checked against the file’s permissions and if the request mode is allowed the file is opened for the process. It returns a pointer to the open file table.

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

What are the differences between per-process open-file table and a system-wide open-file table?

A

The per-process table tracks all files that a process has open. Stored in this table is information regarding the process’s use of the file. For instance, the current file pointer for each file is found here. Access rights to the file and accounting information can also be included.

The system wide table is process independent. It contains information such as the location of the file on disk, access dates and file size.

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

Why information about the location of the file is kept in memory?

A

It’s kept in memory so the system does not have to read it from the directory structure for each operation.

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

What is the reason to design an operating system which recognizes the type of a file

A

The operating system needs to recognize the type of the file so it can access and operate on it in the correct way.

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

What is the main disadvantage of having the operating system support multiple file structures?

A

It makes the operating system large and more complicated. Code must be implemented to support each type of file that is to be included. And it may be necessary to define every file as one of the types supported by the OS.

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

What does it mean internal fragmentation associated with the internal file structure?

A

Disk systems usually have well defined block size and all blocks are the same. But logical records vary in length and size. So any extra memory not allocated in the blocks is wasted and suffers from internal fragmentation. The greater the block size the greater the fragmentation.

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

Is it possible that read_next() operation is used in direct access method?

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

Describe the main drawback of single-level directory structure

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

What is the internal representation of a directory in tree-structured directory?

A

In the internal format of tree-structured directories one bit in each directory entry defines the entry as a file (0) or as a subdirectory (1). They have special system calls used to create and delete directories.

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

Describe the file protection method use by the UNIX system.

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

What are the main disadvantages of associating a password with each file?

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

How does MS Windows API implement shared memory using memory-mapped files?

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

T/F - Is the set of the file’s attributes the same for each operating system?

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

T/F - Reading and writing a file operations use the same current-file-position pointer.

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

T/F - Truncating a file operation resets values of all its attributes and releases its file space.

A

False. Truncating is for when a user wants erase the contents but keep the attributes. It allows all the file attributes to remain the same except for the length. The file can be reset to length zero and then its file space can be released.

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

T/F- create() system call uses open-file table.

A

False. open() system call uses open-file table

17
Q

T/F - an extension is a part of a file name

A

True. An extension denotes what kind of file and what operations can be done on the file. It comes after the period.

18
Q

T/F - All operating systems have to support at least one file structure.

A
19
Q

T/F - The length of a logical record is fixed for a given operating system.

A

False. Logical records can vary in length

20
Q

T/F - All file systems suffer from internal fragmentation.

A
21
Q

T/F - Sequential access to a file is based on a disk model of a file.

A

False. sequential access is based on tape model of a file
Direct access method is based on disk model since disks allow random access to any file block

22
Q

T/F - In two-level directory structure, the system’s master file directory (MFD) is searched when a user logs in.

A
23
Q

T/F - In tree-structured directory the search path always contains “the current directory”

A

True

24
Q

T/F - UNIX rm command can delete a non-empty directory

A
25
Q

T/F - Systems that do not permit access to the files of another user do not need protection

A
26
Q

T/F - Writes to the file mapped in memory are not necessarily immediate writes to the file on disk

A