Chapter 7 (File Handling) Flashcards
a collection of data stored on a nonvolatile device in a computer system
a computer file
What describes a permanent storage device wherein data items saved onto them are available for future use?
Durable
What are the 2 categories of computer files?
- text files
2. binary files
oftentimes, this designates the software that will be used to open a given file.
filename extension
what is the base unit that file sizes are measured in?
bytes
thousands of bytes
kilobyte
billions of bytes
gigabyte
What are the 2 organizational units on a storage device?
Directories and folders
Each computer files has a ________, by default. You cannot save a file without it.
filename
data that has not been encoded by text / cannot be read in a text editor.
binary files
Terms such as “temporary” and “permanent” do NOT refer to length of time, they refer to _______.
volatility
disk drive + the complete hierarchy of directories in which a file resides
a file’s “path”
When writing a program that stores a value in a variable, you are using ___________ storage.
temporary
the relationship among data components
data hierarchy
letters, numbers, and special symbols; they include seemingly “empty” symbols such as spaces and tabs
characters
The value of a variable is temporarily stored, so it is lost when the program ends or if the computer…
loses power
What is another term for permanent storage?
persistent storage
Files are…
a group of related records.
Characters -> ______ -> _______ -> Files
Fields, Records
these hold related file data in tables
database
These can contain multiple files as well as additional of itself.
Directories
True or False: functionally, directories and folders are the same.
True
Records are a group of ______ that go together for some logical reason.
fields
a million bytes
megabytes
A folder is a ___ representation of a directory.
GUI (Graphical User Interface)
To make a program read a file’s data from a storage device, you also need to associate the program’s internal _______ with the operating system’s name for the file.
filename
Locating a file on a storage device and associating a variable name within your program with the file.
Opening the file
reading from a file is…
copying data from a file on a storage device into RAM
Changes made to the fields in memory affect the original data stored on the input device. True or False?
False
a character stores between data fields (such as a comma, semicolon, or tab)
delimiter
True or False: data item retrieval from storage is not program-language specific?
False
What are the 2 ways that a program can read records from a file?
- Sequentially
2. Randomly
Ascending order and descending order are the types of ______ you can do with records.
Sorting
storing data in a computer file on a persistent storage device; copying data from RAM to the file.
“write to the file”
When writing data to a file, you do not include ________ that make data easier for humans to interpret.
explanations
Making a file unavailable to your program/application
to “close the file”
When you close a file as soon as you no longer need it, you prevent the computer’s…
performance from suffering and loss of computer resources (energy, RAM, etc).
What is the main default input device?
a keyboard
a copy of a file that is kept in case values need to be restored to their original state.
backup file
a newly revised copy of the parent file
child file
these are read from beginning to end, one at a time
sequential files
a temporary detour in the logic of a program
control break
What is another name for a backup file?
a “parent file”
What is the main default output device?
a monitor
a break in the logic of the program that is based on the value of a single variable
single-level control break
Do you initialize a single-level control break when it is declared?
No, you wait for it to be processed by the first input record. This allows for accurate storage.
A form of output that includes special processing after each group of records
control break report
In a ______ _____ _______, a change in the value of a variable initiates special actions or causes unique processing to occur.
control break program
To generate a control break report input records must be organized in ________ order based on the field that will trigger the break.
sequential
files in which records can be accessed immediately
instant access files
These are used to take special action to better organize information it’s working on by some logical factor.
control break programs
The technique used for the computer to “remember” the old value, so as to compare it to the new value to see if they are identical, is by giving that old value a special variable. This special variable is called a…
control break field
Comparing the old value to the new value will ultimately determine when to produce the…
control break
combining two or more files while maintaining the sequential order of the records
Merging files
The control break requires 3 things:
- The field must be output
- The new element must be re-initialized.
- The field must be updated to hold the new (comparing) value
Master file holds complete and relatively permanent data, while the _________ file holds temporary data.
transaction
processing which involves performing the same tasks with many records, one after the other, and often done without human intervention
batch processing
Making appropriate changes to the values in its fields based on the recent transactions is called…
“Updating the master file”
Direct access files come in handy when dealing with a program wherein the user makes direct requests, or ________ program.
interactive
Before doing this to files, each file must:
- contain the same record layout
- be sorted in the same order based on the same field.
merging files
The _____ is the combination of the disk drive plus the complete hierarchy of directories in which a file resides.
path
Applications that require a record be accessed immediately while a client or user waits are processed in ____ ____.
real-time
Random access memory is….
persistent.
A control break occurs when a program pauses to perform special processing based on the value of a _____.
field
Whenever a control break occurs during record processing in any control break program, you must ______ the value in the _______ _____ _____.
update, control break field
What are the two types of random access files?
- instant access files
2. direct access files
What is the main difference between a direct access file and an instant access file?
The instant access files have records that can be accessed immediately.