File modes: READ and WRITE
States what a program will do with an open file: READ gets data out of it, WRITE puts data into it. A file is open in only one mode at a time, chosen by what the program needs.
Understanding File modes: READ and WRITE in IGCSE Computer Science Paper 2
What it does: Getting data out of a file needs READ mode, so FOR READ is written after the file name. In 0478 pseudocode a file is opened in one mode only. To change what you do with it, close it and open it again in the other mode.
Common mistakes: The file was opened FOR READ, so the program can only read from it. It must use READFILE "names.txt", Name to get data out. WRITEFILE needs the file to be open FOR WRITE. The program wants to put Score into the file with WRITEFILE, so the file must be opened FOR WRITE. FOR READ only lets the program get data out of the file.
Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.
This module's key terms are also in a printable crossword (Modules 479–488) and word search (Modules 479–499).
Take this worksheet further — free with Cloodit
Each concept is reinforced from every angle — learned, then applied, then tested.
Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.
Over 100 of them, across seven natural biomes.
Turns their work into revision material ready for Flash Cards and Exam study.
Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.
Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.
Quick Questions
Match the Pairs
Key Term
file modeFill in the Blanks
Spot the Error
Student with a class code? Join your class →