Each file can be accessed through a file mode. These file modes decide what…
2023
Each file can be accessed through a file mode. These file modes decide what action can be performed in the file. If the file mode is <r> then we can only ______ the contents of the file.
- A.
read
- B.
write
- C.
delete
- D.
overwrite
- E.
Question not attempted
Attempted by 1954 students.
Show answer & explanation
Correct answer: A
The file mode <r> is used to open a file for reading only. This means that the contents of the file can be accessed, but no modifications such as writing, deleting, or overwriting are allowed. The system restricts any write operations to ensure data integrity and prevent accidental changes. Therefore, the only action permitted in this mode is reading the file contents.