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

Multiple choice
  1. Random access file takes less time for reading than a sequential file.

  2. getw() function reads all data types from a file.

  3. Closall() function closes all the opened files in a program.

  4. ofstream is a class to read the data from a file.

  5. None of these

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

This is correct.

Multiple choice
  1. seekp()

  2. rewind()

  3. ftell()

  4. fseek()

  5. fread()

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

The fseek() is used to move the pointer at any position in a file. It is used in programs where we want to read or write data from/to a specific position in a file. It has the following syntax - fseek(filepointer,int bytes,int offset) where file pointer is a pointer pointing to a file. bytes - is the number of bytes that we want to move. offset - denotes the position from where we want to move.for example  fseek(fp,10,0) will move the pointer 10 bytes from the beginning.

Multiple choice
  1. InputStream

  2. InputStreamReader

  3. FileInputstream

  4. StreamReader

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

The openFileInput() method returns a FileInputStream (note the specific capitalization with lowercase 'stream'), which is used to read bytes from a file stored in the app's internal storage. It does not return the abstract InputStream or character-based Reader classes.

Multiple choice
  1. read data from file

  2. write data to file

  3. Both (1) and (2)

  4. None of these

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

The openFileOutput() method is used to write data to a file in the app's internal storage. It returns a FileOutputStream. For reading, you would use openFileInput(). These are separate operations - openFileOutput() is specifically for writing, not reading or both.

Multiple choice
  1. Both (a) and (b)

  2. Only (a)

  3. Only (b)

  4. None of these

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

The Java File constructor can accept both directory paths and file paths - it represents an abstract path that may refer to either. File objects can be used to check status of both directories (via isDirectory()) and regular files (via isFile()).

Multiple choice
  1. Content Providers represent files as fully qualified URIs.

  2. openOutputStream method is used to insert a file into a Content Provider.

  3. openInputStream method is used to access a saved file.

  4. The file compresses the bitmap and saves it into the provider.

  5. There will be no exception possible while saving the file.

Reveal answer Fill a bubble to check yourself
E Correct answer
Explanation

The FileNotFoundException is possible while saving the file.

Multiple choice
  1. One must save all the projects in manifest file.

  2. All the backup versions will be stored in manifest file under manifest directory.

  3. All the components of an android application must be declared in Androidmanifest.xml file.

  4. There is no manifest file in android development.

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

.