Introduction to File Processing
Overview of File Processing and Definitions
In Lesson 2, we saw that a piece of information used in an application was primarily
represented as a group of bits. So far, if we requested information from the user, when the
application exited, we lost all information that the user had entered. This is because such
information was only temporarily stored in the random access memory (RAM). In some cases,
you will want to "keep" information that the user has entered so you can make the information
available the next time the user opens the application. In some other cases, whether you
request information from the user or inherently provide it to the user, you may want different
people working from different computers to use or share the same data. In these and other
scenarios, you must store the information somewhere and retrieve it when necessary. This is
the basis of file processing.
A file is a series of bytes of data that are arranged in a particular manner to produce a usable
document. For easy storage, location, and management, the bytes are stored on a medium such
as a hard disc, a floppy disc, a compact disc, or any valid and supported type of storage. When
these bytes belong to a single but common entity and hold values that are stored on a medium,
the group is referred to as a file.
For greater management, files can be stored in a parent object called a directory or a folder.
Since a file is a unit of storage and it stores information, it has a size, which is the number of
bits it uses to store its values. To manage it, a file has a location also called a path that
specifies where and/or how the file can be retrieved. Also, for better management, a file has
attributes (characteristics) that indicate what can be done on the file or that provide specific
information that the programmer or the operating system can use when dealing with the file.
File processing consists of creating, storing, and/or retrieving the contents of a fil