File Handling (OCR GCSE Computer Science): Flashcards

📚Flashcards
File Handling
Sign up to keep revising.Create a free account to study more flashcards and track your progress.

Practise the cards

12 cards from this deck

Show

Purpose of file handling

Store, retrieve & update data on disk

Four key file operations

Open, read, write, close

Must do this before reading/writing a file

Open the file

Mode to open file for extracting data

Reading mode (read)

Mode to open file to create/modify it

Writing mode (write)

Mode to add data to existing file without overwriting

Append mode

What reading a file means

Extracting data from it

How files are typically read

Line by line or in chunks

Effect of write mode on existing file contents

May be overwritten (unless append mode)

Why close a file after use

Free system resources & save changes

Python syntax to open file for reading

open("file.txt", "r")

Python syntax to open file for writing

open("file.txt", "w")

Explore OCR GCSE Computer Science Revision Notes by Topics

Explore OCR GCSE Computer Science Model Answers by Topics

Explore OCR GCSE Computer Science Quizzes by Topics

Explore OCR GCSE Computer Science Exam Questions by Topics

Join 100,000+ GCSE students studying Flashcards with us.

Select your subjects, and get access to A+ resources today.