Computer Knowledge
Computer File Systems
1,249 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
-
WORKING-STORAGE
-
FILE SECTION
-
CONTROL SECTION
-
LINKAGE SECTION
B
Correct answer
Explanation
In COBOL, Sort Description (SD) entries, which define the structure of sort work files, must be declared in the FILE SECTION of the DATA DIVISION. Other sections like WORKING-STORAGE, LINKAGE, or non-existent sections like CONTROL do not hold file or sort descriptions.
-
RECORD NOT FOUND
-
AT END
-
DUPLICATE RECORD
-
END OF FILE
B
Correct answer
Explanation
In COBOL, FILE STATUS = 10 indicates end-of-file condition. The AT END clause is specifically designed to handle this situation, allowing the program to execute a block of code when all records have been processed, making it a cleaner alternative to explicitly checking FILE STATUS.
-
WORKING-STORAGE
-
FILE SECTION
-
CONTROL SECTION
-
LINKAGE SECTION
B
Correct answer
Explanation
In COBOL programming, the short description of a file is typically given in the FILE SECTION.
Option A) WORKING-STORAGE - This section is used to define variables and data items that are used within the program for temporary storage or calculations.
Option B) FILE SECTION - This section is used to define the files that the program will read from or write to. It includes the short description of the file, along with details such as the file organization, access mode, and record structure.
Option C) CONTROL SECTION - This section is used to define the logic and control structures of the program, such as the PROCEDURE DIVISION and the various paragraphs, sections, and statements within it.
Option D) LINKAGE SECTION - This section is used to define data items that are passed between programs in a COBOL program.
The correct answer is B) FILE SECTION. This is where the short description of a file is typically given in COBOL programming.
-
Yes
-
No
-
after supervisors permission
-
Cant say
B
Correct answer
Explanation
When a file is opened as Read Only, you cannot save changes to the original file - the read-only attribute prevents modifications. To save, you would need to either close and reopen with write permissions or save to a different location/filename.
-
My Documents
-
My Computer
-
Start: Search
-
Start: Run
C
Correct answer
Explanation
In Windows XP and earlier versions, clicking Start and then selecting Search opens the Search Companion where you can search for files and folders. My Documents and My Computer are just folders/locations, not search interfaces. Start > Run opens the Run dialog for executing commands, not for searching files.
-
<!--include file="time.inc"-->
-
<?php include_file("time.inc"); ?>
-
<?php require("time.inc"); ?>
-
<% include file="time.inc" %>
C
Correct answer
Explanation
In PHP, require() is used to include a file, and the file will cease processing if it cannot be found - this is the correct syntax shown in option C. Option A shows HTML comment syntax, option B uses a non-existent function include_file(), and option D shows ASP-style syntax which is not standard PHP.
-
type filename
-
file filename
-
desc filename
-
.filename
B
Correct answer
Explanation
The 'file' command examines file contents to determine and report the file type, unlike simple extensions. It works by analyzing magic numbers and file headers. Options A, C, and D are not valid Unix commands for file type detection.
-
ls -lrt file1
-
ls -lR file1
-
find . -s file1
-
find . -name file1
D
Correct answer
Explanation
The find command is used to search directories recursively. The -name option specifies the filename pattern to search for, making find . -name file1 correct. ls commands list files but do not perform recursive file-matching searches, and find . -s is invalid syntax for this purpose.
-
if the output of “cmp -s file1 file2” is not zero
-
if the output of “cmp -s file1 file2” is zero
-
if the output of “cmp -s file1 file2” is one
-
if the output of “cmp -diff file1 file2” is zero
B
Correct answer
Explanation
The cmp utility compares two files byte-by-byte. The -s option runs it silently, returning an exit status of 0 if the files are identical, and 1 if they differ. Other options like -diff are invalid, and a non-zero or 1 exit status indicates differences or errors.
C
Correct answer
Explanation
The cp -p command preserves file attributes including timestamps (atime and mtime), ownership, and mode. Regular cp copies content only. cp -r/-R are for recursive directory copies, and cp -i prompts before overwriting.
-
inode
-
filter
-
kernel
-
shell
A
Correct answer
Explanation
An inode is a Unix data structure that stores file metadata (permissions, ownership, size, timestamps, block pointers). Each file has a unique inode number. Kernel, shell, and 'filter' are not file identification structures.
-
&> filename
-
1> filename
-
2> /dev/null
-
2> filename
D
Correct answer
Explanation
In shell redirection, file descriptor 2 represents stderr (standard error), so 2> filename redirects error messages to the specified file. Option A's &> redirects both stdout and stderr together, while option B's 1> only redirects stdout. Option C redirects errors to /dev/null, discarding them rather than saving to a file.
-
vi filename
-
touch filename
-
cat filename
-
more filename
B
Correct answer
Explanation
The touch command creates an empty file without opening it for editing. The vi command opens the file in the editor, while cat and more are used to read existing files, not create new ones.
-
File and Data Sets preserve partitioning.
-
File and Data Sets are stored in internal format.
-
File and Data Sets contain header file and data files.
-
File and Data Sets are readable by external applications.
A,C
Correct answer
Explanation
Both File Sets and Data Sets preserve partitioning metadata and consist of a header file plus data files. However, File Sets are readable by external applications (text format), while Data Sets use internal DataStage format and are not externally readable. Option B incorrectly states both are internal.
-
File sets are partitioned.
-
File sets are unpartitioned.
-
File sets are stored as a single file.
-
File sets are readable by external applications.
-
File sets are stored as header file and data files.
A,D,E
Correct answer
Explanation
File Sets are partitioned (A), stored as a header file plus separate data files (E), and are readable by external applications since they use text format (D). They are not unpartitioned (B is wrong) and not stored as a single file (C is wrong).