HOME

TheInfoList




A computer file is a computer resource for recording
data Data (; ) are individual facts, statistics, or items of information, often numeric. In a more technical sense, data are a set of values of qualitative property, qualitative or quantity, quantitative variable (research), variables about one or m ...
in a
computer storage device File:Maxell DVD-RW 4.7GB crop 20051120.jpg, A spindle of DVD-RW's. Computer data storage is a technology consisting of computer components and Data storage device, recording media that are used to retain digital data (computing), data. It is ...
, primarily identified by its
file name A filename or file name is a name used to uniquely identify a computer file A computer file is a computer resource for recording data Data are units of information Information can be thought of as the resolution of uncertainty; i ...
. Just as words can be written to paper, so can data be written to a computer file. Files can be edited and transferred through the Internet on that particular computer system. Different types of computer files are designed for different purposes. A file may be designed to store a
Image An SAR radar image acquired by the SIR-C/X-SAR radar on board the Space Shuttle Endeavour shows the Teide volcano. The city of Santa Cruz de Tenerife is visible as the purple and white area on the lower right edge of the island. Lava flows ...
, a written message, a
video Video is an electronic Electronic may refer to: *Electronics Electronics comprises the physics, engineering, technology and applications that deal with the emission, flow and control of electrons in vacuum and matter. It uses active de ...
, a
computer program In imperative programming In computer science, imperative programming is a programming paradigm that uses Statement (computer science), statements that change a program's state (computer science), state. In much the same way that the imperative mo ...
, or any wide variety of other kinds of data. Certain files can store multiple data types at once. By using computer programs, a person can open, read, change, save, and close a computer file. Computer files may be reopened, modified, and copied an arbitrary number of times. Files are typically organized in a
file system In computing Computing is any goal-oriented activity requiring, benefiting from, or creating computing machinery. It includes the study and experimentation of algorithmic processes and development of both computer hardware , hardware and softwa ...
, which tracks file locations on the disk and enables user access.


Etymology

The word "file" derives from the Latin ''filum'' ("a thread"). "File" was used in the context of computer storage as early as January 1940. In ''Punched Card Methods in Scientific Computation'', W. J. Eckert stated, "The first extensive use of the early Hollerith Tabulator in astronomy was made by
Comrie Comrie (; Gaelic: ''Cuimridh''; Pictish: ''Aberlednock''; Latin Latin (, or , ) is a classical language belonging to the Italic languages, Italic branch of the Indo-European languages. Latin was originally spoken in the area around Rome, k ...
. He used it for building a table from successive differences, and for adding large numbers of harmonic terms". "Tables of functions are constructed from their differences with great efficiency, either as printed tables or as a
file of punched cards
'." In February 1950, in a
Radio Corporation of America The RCA Corporation was a major American electronics company, which was founded as the Radio Corporation of America in 1919. It was initially a patent trust owned by General Electric General Electric Company (GE) is an American Multination ...
(RCA) advertisement in ''
Popular Science Popular science (also called pop-science or popsci) is an interpretation of science Science (from the Latin word ''scientia'', meaning "knowledge") is a systematic enterprise that Scientific method, builds and Taxonomy (general), organizes ...
'' magazine describing a new "memory" vacuum tube it had developed, RCA stated: "the results of countless computations can be kept 'on file' and taken out again. Such a 'file' now exists in a 'memory' tube developed at RCA Laboratories. Electronically it retains figures fed into calculating machines, holds them in storage while it memorizes new ones – speeds intelligent solutions through mazes of mathematics." In 1952, "file" denoted, among other things, information stored on
punched card A punched card (also punch cardSteven Pinker, in ''The Stuff of Thought'', Viking, 2007, p.362, notes the loss of ''-ed'' in pronunciation ''as it did in ice cream, mincemeat, and box set, formerly iced cream, minced meat, and boxed set.'' or pu ...

punched card
s. In early use, the underlying hardware, rather than the contents stored on it, was denominated a "file". For example, the
IBM 350 IBM International Business Machines Corporation (IBM) is an American multinational technology company headquartered in Armonk, New York, with operations in over 170 countries. The company began in 1911, founded in Endicott, New York, as th ...
disk drives were denominated "disk files". The introduction, circa 1961, by the
Burroughs MCP The MCP (Master Control Program) is the proprietary operating system An operating system (OS) is system software that manages computer hardware, computer software, software resources, and provides common daemon (computing), services for comput ...
and the MIT
Compatible Time-Sharing System The Compatible Time-Sharing System (CTSS) was one of the first time-sharing In computing Computing is any goal-oriented activity requiring, benefiting from, or creating computing machinery. It includes the study and experimentation of algori ...
of the concept of a "
file system In computing Computing is any goal-oriented activity requiring, benefiting from, or creating computing machinery. It includes the study and experimentation of algorithmic processes and development of both computer hardware , hardware and softwa ...
" that managed several virtual "files" on one storage device is the origin of the contemporary denotation of the word. Although the contemporary "
register file A register file is an array of processor register A processor register is a quickly accessible location available to a computer's processor. Registers usually consist of a small amount of fast storage, although some registers have specific hardw ...
" demonstrates the early concept of files, its use has greatly decreased.


File contents

On most modern
operating system An operating system (OS) is system software System software is software designed to provide a platform for other software. Examples of system software include operating systems like macOS macOS (; previously Mac OS X and later ...

operating system
s, files are organized into one-dimensional arrays of
byte The byte is a unit of digital information that most commonly consists of eight bit The bit is a basic unit of information in computing Computing is any goal-oriented activity requiring, benefiting from, or creating computing machinery. It ...
s. The format of a file is defined by its content since a file is solely a container for data. On some platforms the format is indicated by its
filename extension A filename extension, file extension or file type is an identifier specified as a suffix to the name A name is a term used for identification by an external observer. They can identify a class or category of things, or a single thing, either un ...
, specifying the rules for how the bytes must be organized and interpreted meaningfully. For example, the bytes of a plain text file ( in Windows) are associated with either
ASCII ASCII ( ), abbreviated from American Standard Code for Information Interchange, is a character encoding In computing Computing is any goal-oriented activity requiring, benefiting from, or creating computing machinery. It includes the stu ...
or
UTF-8 UTF-8 is a variable-width character encoding In computing Computing is any goal-oriented activity requiring, benefiting from, or creating computing machinery. It includes the study and experimentation of algorithmic processes and development ...
characters, while the bytes of image, video, and audio files are interpreted otherwise. Most file types also allocate a few bytes for
metadata Metadata is "data that provides information about other data", but not the content of the data, such as the text of a message or the image itself. There are many distinct types of metadata, including: * Descriptive metadata — the descriptive i ...

metadata
, which allows a file to carry some basic information about itself. Some file systems can store arbitrary (not interpreted by the file system) file-specific data outside of the file format, but linked to the file, for example
extended attributesExtended file attributes are file system In computing, a file system or filesystem (often abbreviated to fs) controls how data is Computer data storage, stored and retrieved. Without a file system, data placed in a storage medium would be one large ...
or forks. On other file systems this can be done via
sidecar file Sidecar files, also known as buddy files or connected files, are computer files that store data (often metadata Metadata is " data" that provides information about other data". In other words, it is "data about data". Many distinct types of me ...
s or software-specific databases. All those methods, however, are more susceptible to loss of metadata than
container box. File:Railroad car with container loads.jpg, A Flatcar#Spine car, spine car with a tank container and an open-top intermodal container, intermodal shipping container with canvas cover. A container is any receptacle or enclosure for holdin ...
and
archive file In computing, an archive file is a computer file that is composed of one or more files along with metadata. Archive files are used to Linker (computing), collect multiple data files together into a single file for easier Software portability, por ...
formats.


File size

At any instant in time, a file have a size, normally expressed as number of
byte The byte is a unit of digital information that most commonly consists of eight bit The bit is a basic unit of information in computing Computing is any goal-oriented activity requiring, benefiting from, or creating computing machinery. It ...
s, that indicates how much storage is associated with the file. In most modern operating systems the size can be any non-negative whole number of bytes up to a system limit. Many older operating systems kept track only of the number of blocks or
tracks Track or Tracks may refer to: Routes or imprints * Ancient trackway, any track or trail whose origin is lost in antiquity * Animal track, imprints left on surfaces that an animal walks across * Desire path, a line worn by people taking the shortes ...
occupied by a file on a physical storage device. In such systems, software employed other methods to track the exact byte count (e.g.,
CP/M CP/M, originally standing for Control Program/Monitor and later Control Program for Microcomputers, is a mass-market operating system An operating system (OS) is system software System software is software designed to provide a platform f ...
used a special control character, Ctrl-Z, to signal the end of text files). The general definition of a file does not require that its size have any real meaning, however, unless the data within the file happens to correspond to data within a pool of persistent storage. A special case is a zero byte file; these files can be newly created files that have not yet had any data written to them, or may serve as some kind of
flag A flag is a piece of fabric A textile is a flexible material made by creating an interlocking network of yarn Yarn is a long continuous length of interlocked fibres, suitable for use in the production of textiles, sewing, crochetin ...
in the file system, or are accidents (the results of aborted disk operations). For example, the file to which the link points in a typical
Unix-like A Unix-like (sometimes referred to as UN*X or *nix) operating system An operating system (OS) is system software that manages computer hardware, computer software, software resources, and provides common daemon (computing), services for compu ...
system probably has a defined size that seldom changes. Compare this with which is also a file, but as a character special file, its size is not meaningful.


Organization of data in a file

Information in a computer file can consist of smaller packets of information (often called "
records A record, recording or records may refer to: An item or collection of data Computing * Record (computer science), a data structure ** Record, or row (database), a set of fields in a database related to one entity ** Boot sector or boot record, rec ...
" or "lines") that are individually different but share some common traits. For example, a payroll file might contain information concerning all the employees in a company and their payroll details; each record in the payroll file concerns just one employee, and all the records have the common trait of being related to payroll—this is very similar to placing all payroll information into a specific filing cabinet in an office that does not have a computer. A text file may contain lines of text, corresponding to printed lines on a piece of paper. Alternatively, a file may contain an arbitrary binary image (a
blob Blob may refer to: Science Computing * Binary blob A proprietary device driver is a closed-source device driver published only in binary code. In the context of free and open-source software, a Proprietary software, closed-source device dr ...
) or it may contain an
executable In computing Computing is any goal-oriented activity requiring, benefiting from, or creating computing machinery. It includes the study and experimentation of algorithmic processes and development of both computer hardware , hardware and so ...
. The way information is grouped into a file is entirely up to how it is designed. This has led to a plethora of more or less standardized file structures for all imaginable purposes, from the simplest to the most complex. Most computer files are used by
computer program In imperative programming In computer science, imperative programming is a programming paradigm that uses Statement (computer science), statements that change a program's state (computer science), state. In much the same way that the imperative mo ...
s which create, modify or delete the files for their own use on an as-needed basis. The programmers who create the programs decide what files are needed, how they are to be used and (often) their names. In some cases, computer programs manipulate files that are made visible to the computer user. For example, in a word-processing program, the user manipulates document files that the user personally names. Although the content of the document file is arranged in a format that the word-processing program understands, the user is able to choose the name and location of the file and provide the bulk of the information (such as words and text) that will be stored in the file. Many applications pack all their data files into a single file called an
archive file In computing, an archive file is a computer file that is composed of one or more files along with metadata. Archive files are used to Linker (computing), collect multiple data files together into a single file for easier Software portability, por ...
, using internal markers to discern the different types of information contained within. The benefits of the archive file are to lower the number of files for easier transfer, to reduce storage usage, or just to organize outdated files. The archive file must often be unpacked before next using.


Operations

The most basic operations that programs can perform on a file are: * Create a new file * Change the access permissions and
attributes Attribute may refer to: * Attribute (philosophy), an extrinsic property of an object * Attribute (research), a characteristic of an object * Grammatical modifier, in natural languages * Attribute (computing), a specification that defines a propert ...
of a file *
Open Open or OPEN may refer to: Music * Open (band) Open is a band. Background Drummer Pete Neville has been involved in the Sydney/Australian music scene for a number of years. He has recently completed a Masters in screen music at the Australian ...
a file, which makes the file contents available to the program * Read data from a file *
Write Writing is a medium of human communication Communication (from Latin ''communicare'', meaning "to share") is the act of developing Semantics, meaning among Subject (philosophy), entities or Organization, groups through the use of sufficien ...
data to a file *
Delete In the database structured query language (SQL), the DELETE statement removes one or more records from a Table (database), table. A subset may be defined for deletion using a condition, otherwise all records are removed. Some Database#Database mana ...
a file * Close a file, terminating the association between it and the program *
Truncate In mathematics and computer science, truncation is limiting the number of numerical digit, digits right of the decimal point. Truncation and floor function Truncation of positive real numbers can be done using the floor function. Given a number ...
a file, shortening it to a specified size within the file system without rewriting any content Files on a computer can be created, moved, modified, grown, shrunk ( truncated), and deleted. In most cases, computer programs that are executed on the computer handle these operations, but the user of a computer can also manipulate files if necessary. For instance,
Microsoft Word Microsoft Word is a word processing software developed by Microsoft Microsoft Corporation is an American multinational corporation, multinational technology company with headquarters in Redmond, Washington. It develops, manufactures, li ...
files are normally created and modified by the Microsoft Word program in response to user commands, but the user can also move, rename, or
delete In the database structured query language (SQL), the DELETE statement removes one or more records from a Table (database), table. A subset may be defined for deletion using a condition, otherwise all records are removed. Some Database#Database mana ...
these files directly by using a file manager program such as
Windows Explorer File Explorer, previously known as Windows Explorer, is a file manager application that is included with releases of the Microsoft Windows operating system from Windows 95 onwards. It provides a graphical user interface for accessing the file sys ...

Windows Explorer
(on Windows computers) or by command lines (CLI). In
Unix-like A Unix-like (sometimes referred to as UN*X or *nix) operating system An operating system (OS) is system software that manages computer hardware, computer software, software resources, and provides common daemon (computing), services for compu ...
systems,
user space A modern computer operating system usually segregates virtual memory into kernel space and user space. Primarily, this separation serves to provide memory protection and hardware protection from malicious or errant software behaviour. Kernel s ...
programs do not operate directly, at a low level, on a file. Only the
kernel Kernel may refer to: Computing * Kernel (operating system) In an operating system with a Abstraction layer, layered architecture, the kernel is the lowest level, has complete control of the hardware and is always in memory. In some systems it ...
deals with files, and it handles all user-space interaction with files in a manner that is transparent to the user-space programs. The
operating system An operating system (OS) is system software System software is software designed to provide a platform for other software. Examples of system software include operating systems like macOS macOS (; previously Mac OS X and later ...

operating system
provides a level of
abstraction Abstraction in its main sense is a conceptual process where general rules and concept Concepts are defined as abstract ideas or general notions that occur in the mind, in speech, or in thought. They are understood to be the fundamental buildin ...
, which means that interaction with a file from user-space is simply through its filename (instead of its
inode The inode (index node) is a data structure in a Unix filesystem, Unix-style file system that describes a File system, file-system object such as a computer file, file or a directory (computing), directory. Each inode stores the attributes and disk ...
). For example, rm ''filename'' will not delete the file itself, but only a
link Link or Links may refer to: Places * Link, West Virginia, an unincorporated community in the US * Link River, Klamath Falls, Oregon, US People with the name * Link (singer) (Lincoln Browder, born 1964), American R&B singer * Link (surname) * ...
to the file. There can be many links to a file, but when they are all removed, the
kernel Kernel may refer to: Computing * Kernel (operating system) In an operating system with a Abstraction layer, layered architecture, the kernel is the lowest level, has complete control of the hardware and is always in memory. In some systems it ...
considers that file's memory space free to be reallocated. This
free space A vacuum is space devoid of matter. The word stems from the Latin adjective ''vacuus'' for "vacant" or "Void (astronomy), void". An approximation to such vacuum is a region with a gaseous pressure much less than atmospheric pressure. Physicist ...
is commonly considered a security risk (due to the existence of file recovery software). Any secure-deletion program uses kernel-space (system) functions to wipe the file's data. File moves within a file system complete almost immediately because the data content does not need to be rewritten. Only the paths need to be changed.


Moving methods

There are two distinct implementations of file moves. When moving files between devices or partitions, some file managing software deletes each selected file from the source directory individually after being transferred, while other software deletes all files at once' only after every file has been transferred. With the mv command for instance, the former method is used when selecting files individually, possibly with the use of wildcards (example: mv -n sourcePath/* targetPath, while the latter method is used when selecting entire directories (example: mv -n sourcePath targetPath). Microsoft
Windows Explorer File Explorer, previously known as Windows Explorer, is a file manager application that is included with releases of the Microsoft Windows operating system from Windows 95 onwards. It provides a graphical user interface for accessing the file sys ...

Windows Explorer
uses the former method for
mass storage In computing Computing is any goal-oriented activity requiring, benefiting from, or creating computing machinery. It includes the study and experimentation of algorithmic processes and development of both computer hardware , hardware and softwa ...
filemoves, but the latter method using
Media Transfer Protocol The Media Transfer Protocol (MTP) is an extension to the Picture Transfer Protocol Picture Transfer Protocol (PTP) is a protocol developed by the International Imaging Industry Association to allow the transfer of images from digital cameras to c ...
, as described in . The former method (individual deletion from source) has the benefit that space is released from the source device or partition imminently after the transfer has begun, meaning after the first file is finished. With the latter method, space is only freed after the transfer of the entire selection has finished. If an incomplete file transfer with the latter method is aborted unexpectedly, perhaps due to an unexpected power-off, system halt or disconnection of a device, no space will have been freed up on the source device or partition. The user would need to merge the remaining files from the source, including the incompletely written (truncated) last file. With the individual deletion method, the file moving software also does not need to cumulatively keep track of all files finished transferring for the case that a user manually aborts the file transfer. A file manager using the latter (afterwards deletion) method will have to only delete the files from the source directory that have already finished transferring.


Identifying and organizing

In modern computer systems, files are typically accessed using names (
filename A filename or file name is a name used to uniquely identify a computer file A computer file is a computer resource for recording data Data (; ) are individual facts, statistics, or items of information, often numeric. In a more techni ...

filename
s). In some operating systems, the name is associated with the file itself. In others, the file is anonymous, and is pointed to by links that have names. In the latter case, a user can identify the name of the link with the file itself, but this is a false analogue, especially where there exists more than one link to the same file. Files (or links to files) can be located in directories. However, more generally, a
directory Directory may refer to: * Directory (computing) In computing Computing is any goal-oriented activity requiring, benefiting from, or creating computing machinery. It includes the study and experimentation of algorithmic processes and developmen ...
can contain either a list of files or a list of links to files. Within this definition, it is of paramount importance that the term "file" includes directories. This permits the existence of directory hierarchies, i.e., directories containing sub-directories. A name that refers to a file within a directory must be typically unique. In other words, there must be no identical names within a directory. However, in some operating systems, a name may include a specification of type that means a directory can contain an identical name for more than one type of object such as a directory and a file. In environments in which a file is named, a file's name and the path to the file's directory must uniquely identify it among all other files in the computer system—no two files can have the same name and path. Where a file is anonymous, named references to it will exist within a namespace. In most cases, any name within the namespace will refer to exactly zero or one file. However, any file may be represented within any namespace by zero, one or more names. Any string of characters may be a well-formed name for a file or a link depending upon the context of application. Whether or not a name is well-formed depends on the type of computer system being used. Early computers permitted only a few letters or digits in the name of a file, but modern computers allow long names (some up to 255 characters) containing almost any combination of
unicode Unicode, formally the Unicode Standard, is an information technology Technical standard, standard for the consistent character encoding, encoding, representation, and handling of Character (computing), text expressed in most of the world's wri ...

unicode
letters or unicode digits, making it easier to understand the purpose of a file at a glance. Some computer systems allow file names to contain spaces; others do not. Case-sensitivity of file names is determined by the
file system In computing Computing is any goal-oriented activity requiring, benefiting from, or creating computing machinery. It includes the study and experimentation of algorithmic processes and development of both computer hardware , hardware and softwa ...
. Unix file systems are usually case sensitive and allow user-level applications to create files whose names differ only in the case of characters.
Microsoft Windows Microsoft Windows, commonly referred to as Windows, is a group of several proprietary {{Short pages monitor file systems, each with different policies regarding case-sensitivity. The common
FAT In nutrition Nutrition is the biochemical Biochemistry or biological chemistry, is the study of chemical processes within and relating to living organisms. A sub-discipline of both chemistry and biology, biochemistry may be divided ...
file system can have multiple files whose names differ only in case if the user uses a
disk editor A disk editor is a computer program In imperative programming In computer science, imperative programming is a programming paradigm that uses Statement (computer science), statements that change a program's state (computer science), state. In mu ...
to edit the file names in the directory entries. User applications, however, will usually not allow the user to create multiple files with the same name but differing in case. Most computers organize files into hierarchies using folders, directories, or catalogs. The concept is the same irrespective of the terminology used. Each folder can contain an arbitrary number of files, and it can also contain other folders. These other folders are referred to as subfolders. Subfolders can contain still more files and folders and so on, thus building a tree-like structure in which one "master folder" (or "root folder" — the name varies from one operating system to another) can contain any number of levels of other folders and files. Folders can be named just as files can (except for the root folder, which often does not have a name). The use of folders makes it easier to organize files in a logical way. When a computer allows the use of folders, each file and folder has not only a name of its own, but also a path, which identifies the folder or folders in which a file or folder resides. In the path, some sort of special character—such as a slash—is used to separate the file and folder names. For example, in the illustration shown in this article, the path uniquely identifies a file called in a folder called , which in turn is contained in a folder called . The folder and file names are separated by slashes in this example; the topmost or root folder has no name, and so the path begins with a slash (if the root folder had a name, it would precede this first slash). Many computer systems use extensions in file names to help identify what they contain, also known as the file type. On Windows computers, extensions consist of a dot (period) at the end of a file name, followed by a few letters to identify the type of file. An extension of identifies a text file; a extension identifies any type of document or documentation, commonly in the
Microsoft Word Microsoft Word is a word processing software developed by Microsoft Microsoft Corporation is an American multinational corporation, multinational technology company with headquarters in Redmond, Washington. It develops, manufactures, li ...
file format A file format is a standard Standard may refer to: Flags * Colours, standards and guidons * Standard (flag), a type of flag used for personal identification Norm, convention or requirement * Standard (metrology), an object that bears ...
; and so on. Even when extensions are used in a computer system, the degree to which the computer system recognizes and heeds them can vary; in some systems, they are required, while in other systems, they are completely ignored if they are presented.


Protection

Many modern computer systems provide methods for protecting files against accidental and deliberate damage. Computers that allow for multiple users implement
file permissionsMost file system In computing, a file system or filesystem (often abbreviated to fs) controls how data is Computer data storage, stored and retrieved. Without a file system, data placed in a storage medium would be one large body of data with no wa ...
to control who may or may not modify, delete, or create files and folders. For example, a given user may be granted only permission to read a file or folder, but not to modify or delete it; or a user may be given permission to read and modify files or folders, but not to execute them. Permissions may also be used to allow only certain users to see the contents of a file or folder. Permissions protect against unauthorized tampering or destruction of information in files, and keep private information confidential from unauthorized users. Another protection mechanism implemented in many computers is a ''read-only flag.'' When this flag is turned on for a file (which can be accomplished by a computer program or by a human user), the file can be examined, but it cannot be modified. This flag is useful for critical information that must not be modified or erased, such as special files that are used only by internal parts of the computer system. Some systems also include a '' hidden flag'' to make certain files invisible; this flag is used by the computer system to hide essential system files that users should not alter.


Storage

Any file that has any useful purpose must have some physical manifestation. That is, a file (an abstract concept) in a real computer system must have a real physical analogue if it is to exist at all. In physical terms, most computer files are stored on some type of data storage device. For example, most
operating system An operating system (OS) is system software System software is software designed to provide a platform for other software. Examples of system software include operating systems like macOS macOS (; previously Mac OS X and later ...

operating system
s store files on a
hard disk A hard disk drive (HDD), hard disk, hard drive, or fixed disk is an electro-mechanical data storage device On a reel-to-reel tape recorder (Sony TC-630), the recorder is data storage equipment and the magnetic tape is a data stora ...

hard disk
. Hard disks have been the ubiquitous form of
non-volatile Non-volatile memory (NVM) or non-volatile storage is a type of computer memory In computing Computing is any goal-oriented activity requiring, benefiting from, or creating computing machinery. It includes the study and experimentation of ...
storage since the early 1960s.Magnetic Storage Handbook 2nd Ed., Section 2.1.1, Disk File Technology, Mee and Daniel, (c)1990, Where files contain only temporary information, they may be stored in
RAM Random-access memory (RAM; ) is a form of computer memory In computing Computing is any goal-oriented activity requiring, benefiting from, or creating computing machinery. It includes the study and experimentation of algorithmic proces ...

RAM
. Computer files can be also stored on other media in some cases, such as
magnetic tape Magnetic tape is a medium for , made of a thin, magnetizable coating on a long, narrow strip of . It was developed in Germany in 1928, based on . Devices that record and playback audio and video using magnetic tape are s and s respectively. A ...

magnetic tape
s,
compact disc The compact disc (CD) is a digital Digital usually refers to something using digits, particularly binary digits. Technology and computing Hardware *Digital electronics Digital electronics is a field of electronics Electronics compri ...

compact disc
s, Digital Versatile Discs,
Zip drive The Zip drive is a removable floppy disk storage system that was introduced by Iomega in late 1994. Considered medium-to-high-capacity at the time of its release, Zip disks were originally launched with capacities of 100  MB, then 250& ...

Zip drive
s,
USB flash drive A USB flash drive (i.e. thumb drive) is a that includes with an integrated interface. It is typically removable, rewritable and much smaller than an . Most weigh less than . Since first appearing on the market in late 2000, as with virtuall ...

USB flash drive
s, etc. The use of
solid state drives A solid-state drive (SSD) is a solid-state storage device that uses integrated circuit assemblies to store data Persistence (computer science), persistently, typically using flash memory, and functioning as secondary storage in the Computer ...
is also beginning to rival the hard disk drive. In Unix-like operating systems, many files have no associated physical storage device. Examples are and most files under directories , and . These are virtual files: they exist as objects within the operating system kernel. As seen by a running user program, files are usually represented either by a file control block or by a
file handle In Unix and Unix-like computer operating systems, a file descriptor (FD, less frequently fildes) is a unique identifier (Handle (computing), handle) for a file (computing), file or other input/output System resource, resource, such as a pipe (Unix), ...
. A file control block (FCB) is an area of memory which is manipulated to establish a filename etc. and then passed to the operating system as a parameter; it was used by older IBM operating systems and early PC operating systems including
CP/M CP/M, originally standing for Control Program/Monitor and later Control Program for Microcomputers, is a mass-market operating system An operating system (OS) is system software System software is software designed to provide a platform f ...
and early versions of
MS-DOS MS-DOS ( ; acronym for Microsoft Disk Operating System, also known as Microsoft DOS) is an operating system An operating system (OS) is system software System software is software designed to provide a platform for other software. Example ...
. A file handle is generally either an
opaque data type In computer science Computer science deals with the theoretical foundations of information, algorithms and the architectures of its computation as well as practical techniques for their application. Computer science is the study of Algori ...
or an integer; it was introduced in around 1961 by the ALGOL-based
Burroughs MCP The MCP (Master Control Program) is the proprietary operating system An operating system (OS) is system software that manages computer hardware, computer software, software resources, and provides common daemon (computing), services for comput ...
running on the
Burroughs B5000Burroughs may refer to: * Former spelling of boroughs *Burroughs, Georgia, a historically African American community now a neighborhood of Savannah, Georgia * Burroughs Corporation, a maker of adding machines and computers * Burroughs (surname), peo ...
but is now ubiquitous.


File corruption

When a file is said to be corrupted, it is because its contents have been saved to the computer in such a way that they cannot be properly read, either by a human or by software. Depending on the extent of the damage, the original file can sometimes be recovered, or at least partially understood. A file may be created corrupt, or it may be corrupted at a later point through overwriting. There are many ways by which a file can become corrupted. Most commonly, the issue happens in the process of
writing Writing is a medium of human communication Communication (from Latin Latin (, or , ) is a classical language belonging to the Italic languages, Italic branch of the Indo-European languages. Latin was originally spoken in the area arou ...
the file to a
disk Disk or disc may refer to: * Disk (mathematics) * Disk storage Music * Disc (band), an American experimental music band * Disk (album), ''Disk'' (album), a 1995 EP by Moby Other uses * Disc (galaxy), a disc-shaped group of stars * Disc (magazin ...
. For example, if an image-editing program unexpectedly crashes while saving an image, that file may be corrupted because the program could not save its entirety. The program itself might warn the user that there was an error, allowing for another attempt at saving the file. Some other examples of reasons for which files become corrupted include: * The computer itself shutting down unexpectedly (for example, due to a power loss) with open files, or files in the process of being saved; * A
download In computer network A computer network is a set of computer A computer is a machine that can be programmed to Execution (computing), carry out sequences of arithmetic or logical operations automatically. Modern computers can perfor ...

download
being interrupted before it was completed; * Due to a
bad sector Bad sector in computing refers to a disk sector on a disk storage unit that is permanently damaged. Upon taking damage, all information stored on that sector is lost. When a bad sector is found and marked, the operating system skips it in the future ...
on the
hard drive A hard disk drive (HDD), hard disk, hard drive, or fixed disk is an electro-mechanical data storage device On a reel-to-reel tape recorder (Sony TC-630), the recorder is data storage equipment and the magnetic tape is a data stora ...

hard drive
; * The user removing a flash drive (such as a
USB stick A USB flash drive (i.e. thumb drive) is a data storage device On a reel-to-reel tape recorder (Sony TC-630), the recorder is data storage equipment and the magnetic tape is a data storage medium. Data Data (; ) are individual fac ...

USB stick
) without properly unmounting (commonly referred to as "safely removing"); * Malicious software, such as a
computer virus A computer virus is a type of computer program that, when executed, replicates itself by modifying other computer programs and Code injection, inserting its own Computer language, code. If this replication succeeds, the affected areas are then ...

computer virus
; * A flash drive becoming too old. Although file corruption usually happens accidentally, it may also be done , as to fool someone else into thinking an assignment was ready at an earlier date, potentially gaining time to finish said assignment. There are services that provide on demand file corruption, which essentially fill a given file with random data so that it cannot be opened or read, yet still seems legitimate. One of the most effective countermeasures for unintentional file corruption is
backing up Reversing (also known as backing up) is the process of driving a vehicle in the reverse direction in order to maneuver. Rear view mirrors are somewhat standard equipment for this endeavor. Extremely large or luxury vehicles may have in addition tec ...

backing up
important files. In the event of an important file becoming corrupted, the user can simply replace it with the backed up version.


Backup

When computer files contain information that is extremely important, a '' back-up'' process is used to protect against disasters that might destroy the files. Backing up files simply means making copies of the files in a separate location so that they can be restored if something happens to the computer, or if they are deleted accidentally. There are many ways to back up files. Most computer systems provide utility programs to assist in the back-up process, which can become very time-consuming if there are many files to safeguard. Files are often copied to removable media such as writable CDs or cartridge tapes. Copying files to another hard disk in the same computer protects against failure of one disk, but if it is necessary to protect against failure or destruction of the entire computer, then copies of the files must be made on other media that can be taken away from the computer and stored in a safe, distant location. The grandfather-father-son backup method automatically makes three back-ups; the grandfather file is the oldest copy of the file and the son is the current copy.


File systems and file managers

The way a computer organizes, names, stores and manipulates files is globally referred to as its ''
file system In computing Computing is any goal-oriented activity requiring, benefiting from, or creating computing machinery. It includes the study and experimentation of algorithmic processes and development of both computer hardware , hardware and softwa ...
.'' Most computers have at least one file system. Some computers allow the use of several different file systems. For instance, on newer MS Windows computers, the older FAT-type file systems of
MS-DOS MS-DOS ( ; acronym for Microsoft Disk Operating System, also known as Microsoft DOS) is an operating system An operating system (OS) is system software System software is software designed to provide a platform for other software. Example ...
and old versions of Windows are supported, in addition to the
NTFS New Technology File System (NTFS) is a proprietary {{Short pages monitor