I/O Flashcards
What does a program do when it needs to save data for future use?
writes a data in a file. Normally used .txt files so far.
Name some software that store data
Word processors Image Editors Spreadsheet Games Web browsers
Programmers usually refer to storing data to a file as?
writing data to
How is a piece of data written to a file?
copied from a variable in RAM to the file
output file
used to describe a file that the data is written to
Why is it called an output file?
because the program stores output in it
What is the process of retrieving data from a file known as?
reading
Input file
used to describe a file that is read from
Why is it called an input file?
because the program gets the input from it
What are the three steps that must be taken when a file is used by a program.
open the file
process the file
close the file
Open the file
Opening a file creates connection between the file and the program.
Opening an output file creates a file on the disk and allows the program to write data to it.
Opening an input file allows to read the data from a file
Process a file
In this step data is either written to the file or read from the file
close a file
When the program is finished using the file, it must be closed. Closing a file disconnects the file from a program.
What are the two types of files?
Binary and text
A text file?
encoded as text using scheme : ASCII or unicode.
Viewable with text editors
A binary file
not converted to text. Cannot be opened with text editors
What are the two file access methods?
sequential
direct
What is Sequential access file?
You access data from the beginning of the file to the end of the file. You cant jump around. Old tape. Cannot hop around. If you want to listen to track #5 have to listen to all tracks 1 -4