A computer file contains and stores information for use by a computer program. It is usually defined as being ‘durable’ storage as it is ready to use by other programs after the program that created it has finished executing.
Used in the context of computing as early as 1950, many people likened computer files to paper documents usually kept in offices of library files – which is where the term file originated from.
Most modern operating systems arrange files into one-dimensional arrays of bytes. A file contains a specific format and can differ in size.
The format of a file can be defined either by its filename extension (.txt, .jpg, .doc) or by its content. The size of a file is normally expressed as a number of bytes, with the number of bytes indicative of how much storage is associated with the file.
Files on a computer can be deleted, moved, created, shrunk and deleted. Basic operations that programs can perform on a file include reading data, writing data, opening a file, changing access permissions, creating a new file and closing a file.
Usually a program executed on a computer performs these operations, but a user can also manipulate files. For example, a user can rename a file in a file manager program or by command lines, or perform the same task in a program like Microsoft Word.