Computer Knowledge
Computer File Systems
1,516 Questions
Computer file systems dictate how data is stored, organized, and retrieved on storage devices. Important concepts include file allocation tables, access mechanisms, and various formats like sequential and video files. Candidates preparing for banking and government exams should practice these fundamentals thoroughly.
File access mechanismsVideo and password filesFile extensionsFile allocation tableSystem metadata
Computer File Systems Questions
-
ios::app
-
ios::ate
-
ios::out
-
ios::trunc
B
Correct answer
Explanation
ios::ate (at end) opens the file and positions the pointer at end, but allows reading/writing anywhere in the file. ios::app only allows appending at end. ios::trunc discards existing content. ios::ate provides random access.
-
Group permission
-
Owner permission
-
World permission
-
Read permission
-
Execute permission
C
Correct answer
Explanation
This type of file permission in Linux is granted to users who have neither the UID nor the GID of the file.
-
append
-
read
-
write
-
none of these
-
rewind()
-
feof()
-
ftell()
-
ungetc()
-
fclose()
C
Correct answer
Explanation
This file control function returns the current position of the file pointer on success and end of file on error.
-
Indexed file
-
Command file
-
Archive file
-
Parameter file
-
Indexed sequential file
E
Correct answer
Explanation
In this file, an overflow area needs to be maintained to permit insertion in sequence.
-
fseek()
-
rewind()
-
feof()
-
ungetc()
-
fopen()
A
Correct answer
Explanation
This file control function is used to reposition the file pointer and returns 0 on success and non-zero value on failure.
-
Indexed file
-
Parameter file
-
Direct file
-
Command file
-
Password file
C
Correct answer
Explanation
This file offers an effective way to organize data when there is a need to access individual records randomly.
-
ungetc()
-
fopen()
-
feof()
-
fscanf()
-
rewind()
D
Correct answer
Explanation
This file function returns the number of items that are successfully read from the file identified by the file pointer.
-
fprintf()
-
fopen()
-
ungetc()
-
feof()
-
rewind()
A
Correct answer
Explanation
This function returns the number of items that are successfully written into the file identified by the file pointer.
-
getc()
-
putc()
-
ungetc()
-
rewind()
-
getInputStream()
B
Correct answer
Explanation
This function is a macro that outputs a character to a file stream specified using file pointer.
-
iostream
-
fstream
-
ofstream
-
ifstream
B
Correct answer
Explanation
fstream is the correct C++ class for file operations that require both input and output capabilities. The ios::in | ios::out flags indicate we need to both read from and write to the file, which fstream supports. iostream only handles console I/O, while ifstream and ofstream are specialized for input-only or output-only operations respectively.
-
Text segment
-
Relocation information
-
Index segment
-
Data segment
-
Allocation
D
Correct answer
Explanation
In this object file format, the data also may be incomplete because of unresolved references to labels in other files.
-
Object program
-
Object file header
-
Text segment
-
Relocation information
-
Proc-Type
B
Correct answer
Explanation
This object file format is used to describe the size and position of the other pieces of file. The overall information about the file, such as size of the code, name of the source file it was translated from and creation data is stored in object header file.
-
iomanip.h
-
stdio.h
-
fstream.h
-
iostream.h
C
Correct answer
Explanation
The fstream.h header file (or in standard C++) provides classes and functions for file input/output operations. The read() function reads data from a file, and open() opens a file stream. iostream.h handles console I/O, stdio.h is for C-style I/O, and iomanip.h is for I/O formatting.
-
file.exe
-
file.doc
-
file.xlf
-
file.xls
D
Correct answer
Explanation
.xls is the standard file extension for Microsoft Excel spreadsheets. The other extensions represent different file types: .exe for executable programs, .doc for Word documents, and .xlf for localization interchange files.