Files Overview

A file is a collection of data that resides on a disk or other persistent storage device.  A common file type is the text file, which is usually human-readable and has data organized into lines.  Text files are commonly edited in Windows using Notepad, and they usually have a .txt file extension.

 

Files are often used for programs that want to retain data between runs.  An example of this is the highest score for a game; it should be remembered from run to run.  Such a file might contain a single number.

 

Files are also used to relieve the user from re-entering data into the program each time it is run.  Many real-world programs work with billions of data items, and it makes no sense for the user to type the data in at each run of the program.

 

Finally, files used to hold program output can later be used as input to the same or other programs.  An output file can also be nicely formatted for human readability, perhaps to be printed as a report.

 

Raptor programs can input  data from a text file and output lines of data to a text file.  During the time that a file is used for input (or output), no input from the keyboard (respectively, output to the Master Console) is possible.