A collection of bytes stored as an individual entity on the computer's hard disk. A file is the common denominator of storage. All data and programs, no matter which kind, are stored as files with an assigned file name that must be unique within the disk folder (directory) it resides in. Files with the same name can reside in separate folders. See folder.
Computers Know Nothing About Data Files
To the computer, a data file is nothing more than a string of bytes that is identified by name and location on the disk. Once read into the computer's memory, the structure of a file is known to the software that manipulates it. For example, database files are made up of a series of records (one per customer, vendor, transaction, etc.). Word processing files contain a continuous flow of text interspersed with format codes (tags).
Except for ASCII text files, which contain only raw text, other data files have proprietary structures. Formatting and descriptive information are contained in headers at the beginning of the file and/or in tags interspersed throughout the file.
Computers Are Very Savvy About Program Files
In contrast to data files, the computer is very aware of the content of an executable program file, which contains instructions. When given the starting point of an instruction in memory, the computer expects to find the strings of bytes in a machine instruction format that it recognizes and is able to follow, one instruction after the other (see machine language).
Following are the major file types. See file association, ASCII file, file system and files vs. folders.
Data File Type Contents
data file
(table) records
document text & format codes
spreadsheet rows & columns of cells
image rows & columns of pixels
drawing list of vectors
CD audio digitized sound waves
compressed audio compressed digital sound waves
MIDI MIDI instructions
video digital video frames
Web page
(HTML file) text, HTML tags & JavaScript
XML file text
batch file text
text file text
source program text
Program File Type Contents
executable binary
program machine language
|