In this section of Operating System’s Storage Management, it contains Operating System’s File Systems – File System Concepts MCQs (Multiple Choice Questions Answers).
This section covers below lists of topics
– File Concept MCQs
– File Attributes MCQs
– File Operations MCQs
– File Types MCQs
– File Structure MCQs
- Directory
- File
- Disk
- All of the above
Data cannot be written to secondary storage unless they are within a file.
2. In Which of the following is a sequence of characters organized into lines (and possibly pages) ?
- Text file
- Source file
- Executable file
- None of the above.
3. In which of the following a sequence of functions, each of which is further organized as declarations followed by executable statements is stored?
- Text file
- Source file
- Executable file
- All of the above.
4. In which of the following file is a series of code sections that the loader can bring into memory and execute?
- Text file
- Source file
- Executable file
- Distributed file
5. A file is named, for the convenience of its human users, and is referred to by its ______
- Name
- Type
- Identifier
- size
6. Which of the following file attribute is the unique tag, usually a number, identifies the file within the file system; it is the non-human-readable name for the file?
- Name
- Identifier
- Size
- Location
7. Which of the following file attribute information is needed for systems that support different types of files?
- Name
- Type
- Identifier
- size
8. Which of the following file attribute a information is a pointer to a device and to the location of the file on that device?
- Name
- Size
- Time, date, and user identification.
- Location
9. Which of the following file attribute, the current size of the file (in bytes, words, or blocks) and possibly the maximum allowed size are included?
- Protection
- Size
- Identifier
- Type
10. Which of the following file attribute Access-control information determines who can do reading, writing, executing, and so on?
- Protection
- identifier
- Type
- Time, date, and user identification
11. The information about all files is kept in the ________ which also resides on secondary storage.
- Disk structure
- Directory structure
- Array structure
- All of the above
The information about all files is kept in the directory structure, which also resides on secondary storage. Typically, a directory entry consists of the file’s name and its unique identifier. The identifier in turn locates the other file attributes.
12. Which of following basic operations that can be performed on files by the operating System’s system calls?
- Read, Write, Delete
- Write, Paint, reposition
- Delete, truncate files, Sorting
- All of the above.
The operating system can provide system calls to create, write, read, reposition, delete, and truncate files.
13. Which of the following steps are necessary to create a file?
- space in the file system must be found for the file
- an entry for the new file must be made in the directory
- space in the file system must be found for the file and an entry for the new file must be made in the directory
- None of the above.
14. Which of the following file operation is also known as file seek?
- Truncating a file
- Deleting a file
- Repositioning within a file
- Reading a file
The directory is searched for the appropriate entry, and the current-file-position pointer is re-positioned to a given value. Repositioning within a file need not involve any actual I/O. This file operation is also known as a file seek
15. Which of the following Statements stands true for creating a file?
- We search the directory for the named file. Having found the associated directory entry, we release all file space, so that it can be reused by other files, and erase the directory entry.
- The directory is searched for the appropriate entry, and the current-file-position pointer is re-positioned to a given value.
- Space in the file system must be found for the file and an entry for the new file must be made in the directory.
- We use a system call that specifies the name of the file and where (in memory) the next block of the file should be put. Again, the directory is searched for the associated entry, and the system needs to keep a read pointer to the location in the file where the next read is to take place.
16. Which of the following Statements stands true for writing a file?
- Given the name of the file, the system searches the directory to find the file’s location. The system must keep a write pointer to the location in the file where the next write is to take place. The write pointer must be updated whenever a write occurs.
- The directory is searched for the appropriate entry, and the current-file-position pointer is re positioned to a given value.
- space in the file system must be found for the file and an entry for the new file must be made in the directory.
- We use a system call that specifies the name of the file and where (in memory) the next block of the file should be put. Again, the directory is searched for the associated entry, and the system needs to keep a read pointer to the location in the file where the next read is to take place.
17. Which of the following Statements stands true for Reading a file?
- Given the name of the file, the system searches the directory to find the file’s location. The system must keep a write pointer to the location in the file where the next write is to take place. The write pointer must be updated whenever a write occurs.
- We search the directory for the named file. Having found the associated directory entry, we release all file space, so that it can be reused by other files, and erase the directory entry.
- space in the file system must be found for the file and an entry for the new file must be made in the directory.
- We use a system call that specifies the name of the file and where (in memory) the next block of the file should be put. Again, the directory is searched for the associated entry, and the system needs to keep a read pointer to the location in the file where the next read is to take place.
18. Which of the following Statements stands true for deleting a file?
- Given the name of the file, the system searches the directory to find the file’s location. The system must keep a write pointer to the location in the file where the next write is to take place. The write pointer must be updated whenever a write occurs.
- We search the directory for the named file. Having found the associated directory entry, we release all file space, so that it can be reused by other files, and erase the directory entry.
- Space in the file system must be found for the file and an entry for the new file must be made in the directory.
- We use a system call that specifies the name of the file and where (in memory) the next block of the file should be put. Again, the directory is searched for the associated entry, and the system needs to keep a delete pointer to the location in the file where the next read is to take place.
19. Which of the following Statements stands true for truncating a file?
- We search the directory for the named file. Having found the associated directory entry, we release all file space, so that it can be reused by other files, and erase the directory entry.
- The directory is searched for the appropriate entry, and the current-file-position pointer is re-positioned to a given value.
- Space in the file system must be found for the file and an entry for the new file must be made in the (directory).
- The user may want to erase the contents of a file but keep its attributes. Rather than forcing the user to delete the file and then recreate it, this function allows all attributes to remain unchanged—except for file length—but lets the file be reset to length zero and its file space released.
20. The operating system keeps a table, called the _______, containing information about all open files.
- per-process table
- system-wide table
- Open-file table
- A and C
When a file operation is requested, the file is specified via an index into this table, so no searching is required.
When the file is no longer being actively used, it is closed by the process, and the operating system removes its entry from the open-file table. Typically, the operating system uses two levels of internal tables: a per-process table and a system-wide 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.
21. The _______________needed to locate the file on disk is kept in memory so that the system does not have to read it from disk for each operation.
- File pointer
- File-open count
- Disk location of the file.
- Access rights
22. This ________ is stored on the per-process table so the operating system can allow or deny subsequent I/O requests.
- File pointer
- File-open count
- Disk location of the file.
- Access rights
23. ______ tracks the number of opens and closes and reaches zero on the last close.The system can then remove the entry.
- File pointer
- File-open count
- Disk location of the file.
- Access rights
As files are closed, the operating system must reuse its open-file table entries, or it could run out of space in the table. Multiple processes may have opened a file, and the system must wait for the last file to close before removing the open-file table entry. The file-open count tracks the number of opens and closes and reaches zero on the last close. The system can then remove the entry.
24. ______ is unique to each process operating on the file and therefore must be kept separate from the on-disk file attributes.
- File pointer
- File-open count
- Disk location of the file.
- Access rights
On systems that do not include a file offset as part of the read() and write() system calls, the system must track the last read– write location as a current-file-position pointer. This pointer is unique to each process operating on the file and therefore must be kept separate from the on-disk file attributes
25. A _____ is akin to a reader lock in that several processes can acquire the lock concurrently.
- Exclusive file lock
- Shared file lock
- Inclusive lock
- Mandatory lock
26. An __________ behaves like a writer lock;only one process at a time can acquire such a lock.
- Exclusive file lock
- Shared file lock
- Inclusive file lock
- Mandatory file lock
27. If a lock is ______, then once a process acquires an exclusive lock, the operating system will prevent any other process from accessing the locked file
- Exclusive file lock
- Shared file lock
- Inclusive file lock
- Mandatory file lock
28. The system uses the _______ to indicate the type of the file and the type of operations that can be done on that file.
- Size
- Location
- Date time
- Extension
29. A file with extension______ is the binary executable file.
- .txt
- .docx
- .sh
- .exe
30. Which of the following file with extension ______is the binary executable file?
- .txt
- .docx
- .sh
- .com
31. _________ is a shell script containing, in ASCII format, commands to the operating system.
- .txt
- .docx
- .sh
- .com
32. binary file containing audio or A/V information
- exe, com, bin or none
- c, cc, java, perl, asm
- xml, html, tex
- mpeg, mov, mp3, mp4, avi
- exe, com, bin or none
- rar, zip, tar
- xml, html, tex
- mpeg, mov, mp3, mp4, avi
34. libraries of routines for programmers
- exe, com, bin or none
- rar, zip, tar
- xml, html, tex
- lib, a, so, dll
35. which of the following are various word-processor formats?
- exe, com, bin or none
- rar, zip, tar
- xml, html, tex
- xml, rtf, docx
36. Which of the following has the file type of markup?
- exe, com, bin or none
- rar, zip, tar
- xml, html, tex
- xml, rtf, docx
37. Which of the following is known as batch file?
- exe, com, bin or none
- obj, o
- lib, a, so, dll
- bat, sh
38. Which of the following file extension is for the file containing source code in various languages?
- exe, com, bin or none
- obj, o
- lib, a, so, dll
- c, cc, java, perl
39. ________file extension has the function of compiled, machine language, not linked.
- exe, com, bin or none
- obj, o
- lib, a, so, dll
- c, cc, java, perl
40. ________file extension contain ready-to-run machine language program.
- exe, com, bin or none
- obj, o
- lib, a, so, dll
- c, cc, java, perl