File handling (3)

Resources | Revision Questions | Computer Science

Login to see all questions

Click on a question to view the answer

1.

Describe the purpose of the open, read, write, and close statements when working with files in a programming language. Explain why it is important to use the close statement.

2.

Explain how a program can access data stored in an external file. Include a discussion of file paths (absolute and relative) and the role of the operating system in managing file access.

3.

Explain the difference between write mode and append mode when opening a file. Provide an example of when you would use each mode.