File System Interface Flashcards
Why is open() call implemented?
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.
What are the differences between per-process open-file table and a system-wide open-file table?
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.
Why information about the location of the file is kept in memory?
It’s kept in memory so the system does not have to read it from the directory structure for each operation.
What is the reason to design an operating system which recognizes the type of a file
The operating system needs to recognize the type of the file so it can access and operate on it in the correct way.
What is the main disadvantage of having the operating system support multiple file structures?
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.
What does it mean internal fragmentation associated with the internal file structure?
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.
Is it possible that read_next() operation is used in direct access method?
Describe the main drawback of single-level directory structure
What is the internal representation of a directory in tree-structured directory?
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.
Describe the file protection method use by the UNIX system.
What are the main disadvantages of associating a password with each file?
How does MS Windows API implement shared memory using memory-mapped files?
T/F - Is the set of the file’s attributes the same for each operating system?
T/F - Reading and writing a file operations use the same current-file-position pointer.
T/F - Truncating a file operation resets values of all its attributes and releases its file space.
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.