Computer file: Difference between revisions
Jump to navigation
Jump to search
imported>JauntKing mNo edit summary |
imported>Bruce1ee Undid revision 1356595027 by ~2026-31922-09 (talk) – better as it was |
||
| Line 2: | Line 2: | ||
{{refimprove|date=June 2009}} | {{refimprove|date=June 2009}} | ||
A '''computer file''' is a collection of [[Data (computing)|data]] | A '''computer file''' is a named collection of [[Data (computing)|data]] treated as a unit by the system that manages it. Today, this system is called a [[File system fragmentation|file system]]<ref name=":0" />. Many older computer systems lacked a distinct file system ''[[wikt:per se|per se]]'', yet a management [[software feature|feature]] is required in order to provide a file [[abstraction]]. | ||
Different [[File format|types of computer files]] are designed for different purposes. A file may be designed to store a written message, a document, a [[spreadsheet]], an [[Digital image|image]], a [[Digital video|video]], a [[computer program|program]], or any wide variety of other kinds of data. Certain files can store multiple data types at once. | Files can be shared with and transferred between [[computers]] and [[Mobile device|mobile devices]] via [[removable media]], [[Computer networks|networks]], or the [[Internet]]. | ||
Different [[File format|types of computer files]] are designed for different purposes. A file may be designed to store a written message, a [[document file format|document]], a [[spreadsheet]], an [[Digital image|image]], a [[Digital video|video]], a [[computer program|program]], 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 [[file copying|copied]] an arbitrary number of times. | By using computer programs, a person can open, read, change, save, and close a computer file. Computer files may be reopened, modified, and [[file copying|copied]] an arbitrary number of times. | ||
==Etymology== | ==Etymology== | ||
[[File:PunchCardDecks.agr.jpg|right|thumb|A [[punched card]] file]] | [[File:PunchCardDecks.agr.jpg|right|thumb|A [[punched-card]] file]] | ||
[[File:BRL61-IBM 305 RAMAC.jpeg|right|thumb|The twin [[Disk storage|disk files]] of an [[IBM 305]] system]] | [[File:BRL61-IBM 305 RAMAC.jpeg|right|thumb|The twin [[Disk storage|disk files]] of an [[IBM 305]] system]] | ||
The word "file" derives from the Latin ''filum'' ("a thread, string").<ref>{{Cite web |title=Online Etymology Dictionary |url=https://www.etymonline.com/index.php?term=file |access-date=2015-08-17 |archive-date=2015-09-24 |archive-url=https://web.archive.org/web/20150924134509/https://www.etymonline.com/index.php?term=file |url-status=live }}</ref> | The word "file" derives from the Latin ''filum'' ("a thread, string").<ref>{{Cite web |title=Online Etymology Dictionary |url=https://www.etymonline.com/index.php?term=file |access-date=2015-08-17 |archive-date=2015-09-24 |archive-url=https://web.archive.org/web/20150924134509/https://www.etymonline.com/index.php?term=file |url-status=live }}</ref> | ||
In extended use the English term "file" came to refer to various systems of arranging papers and documents for retrieval.<ref name=":0"> | |||
{{oed | file}} Recorded from 1525: "A string or wire, on which papers and documents are strung for preservation and reference. Later extended to various other appliances for holding papers so that they can be easily referred to." | |||
</ref> | |||
"File" was used in the context of computer storage as early as January 1940. In ''Punched Card Methods in Scientific Computation'',<ref>{{Cite book |last1=Eckert |first1=W. J. |url=https://catalog.hathitrust.org/Record/002523225 |title=Punched card methods in scientific computation |last2=Thomas J. Watson Astronomical Computing Bureau |first2=New York | "File" was used in the context of computer storage as early as January 1940. In ''Punched Card Methods in Scientific Computation'',<ref>{{Cite book |last1 =Eckert |first1 =W. J. |url =https://catalog.hathitrust.org/Record/002523225 |title =Punched card methods in scientific computation |last2 =Thomas J. Watson Astronomical Computing Bureau |first2 =New York |date =1940 |publisher =The Thomas J. Watson Astronomical Computing Bureau, Columbia University |location =New York |access-date=2018-04-17 |archive-date=2020-06-12 |archive-url =https://web.archive.org/web/20200612015646/https://catalog.hathitrust.org/Record/002523225 |url-status =live }}</ref> W. J. Eckert stated, "The first extensive use of the early Hollerith Tabulator in astronomy was made by [[Leslie Comrie|Comrie]].<ref>{{Cite journal |last =Comrie |first =L. J. |date =1928-04-13 |title=On the Construction of Tables by Interpolation (Plate 6) |journal =Monthly Notices of the Royal Astronomical Society |language =en |volume =88 |issue =6 |pages =506–523 |bibcode =1928MNRAS..88..506C |doi =10.1093/mnras/88.6.506 |issn =0035-8711 |doi-access=free}}</ref> He used it for building a table from successive differences, and for adding large numbers of harmonic terms". "Tables of [[Function (mathematics)|functions]] are constructed from their differences with great efficiency, either as printed tables or as a ''[https://hdl.handle.net/2027/uc1.b3621946?urlappend=%3Bseq=16 file of punched cards]''." | ||
In February 1950, in a [[Radio Corporation of America]] (RCA) advertisement in ''[[Popular Science]]'' magazine<ref>{{Citation |title=Popular Science |date=February 1950 |url=https://books.google.com/books?id=9SwDAAAAMBAJ&pg=PA96 |page=96 |publisher=Bonnier Corporation |access-date=2014-03-07 |mode=cs1 |archive-date=2022-01-09 |archive-url=https://web.archive.org/web/20220109114611/https://books.google.com/books?id=9SwDAAAAMBAJ&pg=PA96 |url-status=live }}</ref> 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 February 1950, in a [[Radio Corporation of America]] (RCA) advertisement in ''[[Popular Science]]'' magazine<ref>{{Citation |title =Popular Science |date =February 1950 |url=https://books.google.com/books?id=9SwDAAAAMBAJ&pg=PA96 |page =96 |publisher=Bonnier Corporation |access-date=2014-03-07 |mode=cs1 |archive-date=2022-01-09 |archive-url =https://web.archive.org/web/20220109114611/https://books.google.com/books?id=9SwDAAAAMBAJ&pg=PA96 |url-status=live }}</ref> 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]]s.<ref>Robert S. Casey, et al. ''Punched Cards: Their Applications to Science and Industry''. 1952.</ref> | In 1952, "file" denoted, among other things, information stored on [[punched card]]s.<ref>Robert S. Casey, et al. ''Punched Cards: Their Applications to Science and Industry''. 1952.</ref> | ||
In early | In early computing usage, the word "file" could refer to the underlying [[computer hardware | hardware]], rather than to the contents stored on it. For example, the [[IBM 350]] disk drives were denominated "disk files".<ref>Martin H. Weik. Ballistic Research Laboratories Report #1115. March 1961. [https://ed-thelen.org/comp-hist/BRL61-ibm03.html#IBM-305-RAMAC pp. 314–331] {{Webarchive |url=https://web.archive.org/web/20161021113333/https://ed-thelen.org/comp-hist/BRL61-ibm03.html#IBM-305-RAMAC |date=2016-10-21 }}.</ref> The introduction, {{circa|1961}}, by the [[Burroughs MCP]] and the MIT [[Compatible Time-Sharing System]] of the concept of a "[[file system]]" that managed several virtual "files" on one storage device is the origin of the contemporary denotation of the word. Although the contemporary "[[register file]]" demonstrates the early concept of files, its use has greatly decreased.{{citation needed|date=August 2025}} | ||
==File system== | |||
A [[file system]] provides the file [[abstraction]] to consuming software—it enables software to organize, name, and manipulate data as files. Although early computers did not contain a distinct file system, the function of what we call file system today is required as was often provided directly by the core operating system. | |||
Not only do modern computer systems include a file system, some systems use multiple. [[Unix-like]] systems typically allow for using multiple file systems. On some Windows systems, the older FAT-type file systems of [[MS-DOS]] and old versions of Windows are supported, in addition to the [[NTFS]] file system that is the normal file system. | |||
==File manager== | |||
A [[file manager]] is a [[utility software |utility]] that allows a user to manipulate files directly. Typically, it allows one to move, create, delete and rename files and directories (a.k.a. folders), although it may not directly support viewing file content. Typically, a computer system has at least one file manager program for its native file system. For example, [[File Explorer]] is commonly used in Windows, and [[GNOME Files |Nautilus]] is in several [[Linux distribution]]s. | |||
==File contents== | ==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 most modern [[operating system]]s, files are organized into one-dimensional arrays of [[byte]]s.<ref>{{Cite web |title=The Unix File System |url=https://fsl.fmrib.ox.ac.uk/fslcourse/unix_intro/fstour.html |access-date=2026-04-11 |website=fsl.fmrib.ox.ac.uk}}</ref> The [[file format|format]] of a file is defined by its content since a file is solely a container for data.<ref>{{Cite web |title=Operating System: File System Management |url=https://www.vbspu.ac.in/e-content/File-System-Management.pdf}}</ref> | ||
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. | 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.{{citation needed|date=August 2025}} | ||
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. | 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.{{citation needed|date=August 2025}} | ||
=== File size === | === File size === | ||
| Line 35: | Line 46: | ||
{{Main article|File size}} | {{Main article|File size}} | ||
File size is a measure of the storage space allocated to the file. Although often expressed in units of [[byte]]s, many older file systems tracked size in larger units such as [[disk sector |blocks]] or [[track (disk drive)|tracks]]. None-the-less, sometimes a more precise measure was available. For example, [[CP/M]] marked the end of a text file with [[Ctrl-Z]] which could be used to obtain a size with byte precision. | |||
Typically, due to its design, a file system limits maximum file size. | |||
=== Organization of data in a file === | === Organization of data in a file === | ||
| Line 67: | Line 78: | ||
=== Moving methods === | === Moving methods === | ||
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. | |||
For example, the <code>[[mv (Unix)|mv]]</code> command uses the former method when moving files individually with [[wildcard character|wildcards]] (example: <code>mv -n sourcePath/* targetPath</code>), but uses the latter method when moving entire directories (example: <code>mv -n sourcePath targetPath</code>). | |||
Microsoft [[Windows Explorer]] also varies its approach: it uses the former method for [[mass storage]] file moves, but uses the latter method when transferring files via [[Media Transfer Protocol]], as described in {{section link|Media Transfer Protocol|File move behavior}}. | |||
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. | 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. | ||
| Line 96: | Line 107: | ||
==Protection== | ==Protection== | ||
Many modern computer systems provide methods for protecting files against accidental and deliberate damage. Computers that allow for multiple users implement [[file permissions]] 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; | Many modern computer systems provide methods for protecting files against accidental and deliberate damage. Computers that allow for multiple users implement [[file permissions]] 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; alternatively, 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 file and hidden directory|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. | 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 file and hidden directory|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== | ==Storage== | ||
Any file that has any useful purpose must have some physical manifestation. | Any file that has any useful purpose must have some physical manifestation. 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]]s store files on a [[hard disk]]. Hard disks have been the ubiquitous form of [[non-volatile]] storage since the early 1960s.<ref name="Mee">Magnetic Storage Handbook 2nd Ed., Section 2.1.1, Disk File Technology, Mee and Daniel, (c)1990,</ref> Where files contain only temporary information, they may be stored in [[RAM]]. Computer files can be also stored on other media in some cases, such as [[magnetic tape]]s, [[compact disc]]s, [[Digital Versatile Disc]]s, [[Zip drive]]s, [[USB flash drive]]s, etc. The use of [[solid state drives]] is also beginning to rival the hard disk drive. | In physical terms, most computer files are stored on some type of data storage device. For example, most [[operating system]]s store files on a [[hard disk]]. Hard disks have been the ubiquitous form of [[non-volatile]] storage since the early 1960s.<ref name="Mee">Magnetic Storage Handbook 2nd Ed., Section 2.1.1, Disk File Technology, Mee and Daniel, (c)1990,</ref> Where files contain only temporary information, they may be stored in [[RAM]]. Computer files can be also stored on other media in some cases, such as [[magnetic tape]]s, [[compact disc]]s, [[Digital Versatile Disc]]s, [[Zip drive]]s, [[USB flash drive]]s, etc. The use of [[solid state drives]] is also beginning to rival the hard disk drive. | ||
| Line 144: | Line 155: | ||
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. | 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. | ||
==See also== | ==See also== | ||
* [[Block (data storage)]] | * [[Block (data storage)]] | ||
* [[Character special file]] | |||
* [[Computer file management]] | * [[Computer file management]] | ||
* [[Data hierarchy]] | * [[Data hierarchy]] | ||
* [[Everything is a file]] | |||
* [[File camouflage]] | * [[File camouflage]] | ||
* [[File copying]] | * [[File copying]] | ||
| Line 165: | Line 173: | ||
* [[Object composition]] | * [[Object composition]] | ||
* [[Soft copy]] | * [[Soft copy]] | ||
* [[Unix file type]] | |||
* [[Zero byte file]] | |||
== References == | == References == | ||