File Handling Flashcards
1
Q
What is the importance of file handling?
A
Without a program having access to data in other files all data in a program would have to be;
Stored in the code
Entered by the user
Received from an external device
2
Q
Name a common type of file handling
A
Scripting code, embedded in an HTML file, to access a database.
3
Q
What will file handling programs usually contain in their code?
A
An instruction to open the file A path to the file Syntax - determines whether connection to the file will be read only, write only or read/write. Data is used accordingly. An instruction to close the file.
4
Q
Pseudocode for file handling
A
SET list TO ["data"] OPEN FILE "filename" FOR each dataitem FROM list DO SEND oneitem TO "filename" END FOR EACH CLOSE FILE "filename"