Nepedia
Back to Discover
Advanced Reader
💻

Computer file

technology Maturity 5-7 Next article →

A computer file is a named collection of data that a computer system treats as a single unit. To manage these units, computers use a file system. This system provides a file abstraction, which allows software to organize, name, and manipulate data.

FileFolders
FileFolders

Without this abstraction, software would struggle to interact with raw data effectively. Files are versatile tools used to store many different types of information. A single file might hold a written message, a document, or a spreadsheet. They can also store images, videos, or complex computer programs. Some files are even designed to hold multiple data types at once.

Most modern operating systems organize the contents of a file as a one-dimensional array of bytes. The specific format of a file is determined by its content. On some platforms, a filename extension tells the computer how to interpret these bytes. For example, a plain text file uses rules like ASCII or UTF-8 to turn bytes into characters. In contrast, image or video files use different rules to interpret the same kind of data. Many files also contain metadata. Metadata is a small amount of extra data that provides basic information about the file itself.

PunchCardDecks.agr
PunchCardDecks.agr

Some file systems even allow for extended attributes or forks, which are pieces of data linked to the file but stored outside the main format.

Files can be organized into smaller packets of information known as records or lines. These packets share common traits even if the individual data points are different. For instance, a payroll file might contain many records, where each record represents one specific employee. This is similar to how an office uses a specific filing cabinet to hold all payroll documents. Some files, called archive files, pack many different data files into one single container. Using archives can make files easier to transfer, reduce storage usage, or help organize old data. However, these archive files often must be unpacked before they can be used again.

History shows that the concept of a "file" has evolved significantly. The word originates from the Latin "filum," meaning a thread or string. This originally referred to strings used to hold papers together for easy reference. In computing, the term appeared as early as January 1940. W. J. Eckert used the term to describe a file of punched cards for astronomical work. By 1950, RCA used the phrase "on file" to describe information held in a new memory tube.

In the early era, "file" sometimes described the hardware itself, such as the IBM 350 disk drives, which were called "disk files."

The modern definition of a file system emerged through systems like the Burroughs MCP and the MIT Compatible Time-Sharing System. These introduced the idea of managing several virtual files on one storage device. Today, different operating systems use different file systems. Unix-like systems can often use multiple file systems at once. Windows systems frequently use the NTFS file system, though they may still support older FAT-type systems from MS-DOS. Users interact with these systems using a file manager. Programs like File Explorer in Windows or Nautilus in Linux allow users to move, create, delete, or rename files and directories.

When a program works with a file, it performs specific operations. These include creating, opening, reading, writing, and closing a file. Programs can also change access permissions or truncate a file, which means shortening it to a specific size. Moving a file within the same file system is usually very fast. This is because the system only changes the file's path rather than rewriting the actual data. However, moving files between different devices is more complex. Some software deletes the original file immediately after a successful transfer. Other software waits until every single file has been transferred before deleting anything from the source. This latter method can be risky if a power failure occurs during the process.

In many systems, the kernel handles the low-level work of managing files. For example, in Unix-like systems, user-space programs do not operate on files directly. Instead, they interact with the kernel through a filename. When a user deletes a file using a command like "rm," they are often just removing a link to that file. The kernel only considers the memory space free once all links to the file are gone. This is why secure-deletion programs must use special kernel-space functions to completely wipe data. Understanding these layers helps explain how data stays organized and secure across all our digital devices.

755 words

Where will your curiosity go next?

Keep exploring at your chosen reading level.

🖼️ Images & Media (3)
File:PunchCardDecks.agr.jpg
PunchCardDecks.agr.jpg
File:BRL61-IBM 305 RAMAC.jpeg
BRL61-IBM 305 RAMAC.jpeg
File:FileFolders.svg
FileFolders.svg
More to explore

🔬 Go deeper

More advanced topics to explore

🪜 Step back

Simpler topics to build understanding

What is Nepedia?

A free, ad-free encyclopedia for children. Every article is written at five reading levels, so the same page works for a five-year-old and a fifteen-year-old — use the level switcher above to see this one change. No account needed to read.