You are viewing a free preview of this lesson.
Subscribe to unlock all 10 lessons in this course and every other course on LearningBro.
This lesson covers file handling for the OCR A-Level Computer Science (H446) specification. You need to understand how programs read from and write to text files, CSV files, and binary files, as well as the difference between sequential and random access.
Data stored in variables is volatile -- it is lost when the program ends. Files provide persistent storage, allowing data to be saved and retrieved between program executions.
| Storage Type | Volatile? | Example |
|---|---|---|
| Variables (RAM) | Yes | Program variables, arrays |
| Files (disk) | No | Text files, databases, images |
When opening a file, you specify a mode that determines how the file can be accessed:
Subscribe to continue reading
Get full access to this lesson and all 10 lessons in this course.