Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Computer file
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==File contents== On most modern [[operating system]]s, files are organized into one-dimensional arrays of [[byte]]s. The [[file format|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]], specifying the rules for how the bytes must be organized and interpreted meaningfully. For example, the bytes of a plain text file ({{Mono|.txt}} in Windows) are associated with either [[ASCII]] or [[UTF-8]] characters, while the bytes of image, video, and audio files are interpreted otherwise. Most file types also allocate a few bytes for [[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 attributes]] or [[Fork (file system)|forks]]. On other file systems this can be done via [[sidecar file]]s or software-specific databases. All those methods, however, are more susceptible to loss of metadata than [[Container format (computing)|container]] and [[archive file]] formats. === File size === {{Misleading|section|date=March 2019}} {{Main article|File size}} At any instant in time, a file has a specific size, normally expressed as a number of [[byte]]s,<ref group="lower-alpha">Can also be shown as kilobytes, megabytes, gigabytes, etc.</ref> that indicates how much storage is occupied by 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 [[disk sector|blocks]] or [[track (disk drive)|tracks]] 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]] 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 (computing)|flag]] in the file system, or are accidents (the results of aborted disk operations). For example, the file to which the link {{Mono|/bin/ls}} points in a typical [[Unix-like]] system probably has a defined size that seldom changes. Compare this with {{Mono|[[/dev/null]]}} 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 "[[Row (database)|records]]" 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 [[Binary blob|blob]]) or it may contain an [[executable]]. 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]]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 processor|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]], 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.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)