Ch. 5.11: Using Files for Data Storage Flashcards
What does writing data mean?
When a piece of data is written to a file, it is copied from a variable in RAM to the file.
What is an output file?
A file to which data is written.
What does reading data mean?
When a piece of data is read from a file, it is copied from the file into a variable in RAM.
What is an input file?
A file from which data is read. It is called an input file because the program gets input from the file.
What is a text file?
A text file contains data that has been encoded as text, using a scheme such as ASCII or Unicode.
What is a binary file?
A binary file contains data that has not been converted to text. Thus you cannot view the contents of a binary file.
What is a sequential-access file?
When you work with a sequential-access file, you access data from the beginning of the file to the end of the file.
What is a random/direct access file?
You can jump directly to any piece of data in the file without reading the data that comes before it.
What is a filename?
Files on a disk are identified by a filename.
What is a filename extension?
Short sequences of characters that appear at the end of a filename preceded by a period known as a dot.
What is a file stream object?
A file stream object is an object that is associated with a specific file and provides a way for the program to work with that file. It is called a “stream” object because a file can be thought of as a stream of data.
What is a file buffer:
A small “holding section” of memory to which file-bound data is first written.
What is a read position?
A file’s read position marks the location of the next byte that will be read from the file.