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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Name a common type of file handling

A

Scripting code, embedded in an HTML file, to access a database.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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"
How well did you know this?
1
Not at all
2
3
4
5
Perfectly