File (computing)
A file or file computer is a sequence of bytes stored on a device. A file is identified by a name and the description of the folder or directory that contains it. Computer files are so called because they are the digital equivalents of the files written on files, cards, notebooks, paper, or microfiche in the traditional office environment.
Contents of files
As far as the operating system is concerned, a file is, in most cases, simply a one-dimensional stream of bytes, which is treated by the operating system as a single logical unit. A computer data file typically has a size, usually expressed in bytes; on all modern operating systems, the size can be any non-negative integer number of bytes up to a system-dependent maximum. It is up to the software running on the computer to interpret this basic structure as, for example, a program, text, or image, based on its name and content. Special types of files, such as device nodes that symbolically represent pieces of hardware, do not consist of a stream of bytes and have no file size.
The data in a computer file typically consists of smaller packets of data (often called records or lines) that are individually different but share some common feature. For example, a payroll file may contain data on all employees in a company and their payroll details; each record in the payroll file relates to only one employee, and all records have the common characteristic of being payroll-related - this is very similar to putting all your payroll data in a particular filing cabinet in an office that has no payroll computer. A text file can contain lines of text, corresponding to lines printed on a sheet of paper.
How data is grouped in a file is completely up to the person designing the file. This has led to a plethora of more or less standardized file structures for every conceivable purpose, from the simplest to the most complex. Most computer files are used by computer programs. These programs create, modify, and delete files for their own use on demand. The programmers who create the programs decide what files they need, how they are to be used, and (often) their names.
In some cases, computer programs manipulate the files that are made visible to the computer user. For example, in a word processing program, the user manipulates document-files to which he himself names. The content of the file-document is organized in a way that the word processing program understands, but the user chooses the name and location of the file, and provides the information (such as words and text) to be stored in the file.
Many applications package all of their data files into a single file, using internal markers to discern the different types of information they contain. Doom is a clear reference to this.
Files on a computer can be created, moved, modified, enlarged, reduced, and deleted. In most cases, computer programs running on the computer take care of these operations, but a computer user can also manipulate the files if necessary. For example, Microsoft Office Word 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 these files directly using a file manager program as Windows Explorer (on computers with Windows operating system).
Also, a file is a document where one enters some type of Data to store in an object that can be read or modified like a computer.
Identification and organization
In most modern computer systems, files always have names. The files are located in directories. A file name must be unique within that directory. In other words, there can't be more than one file with the same name inside the same directory.
A file's name and path to the file's directory uniquely identifies it among all other files on the computer system - no two files can have the same name and path. The appearance of the name depends on the type of computer system being used. Early computers only allowed a few letters or digits in a file name, but modern computers allow long names containing almost any combination of Unicode letters and Unicode digits, making it easier to understand a file's purpose at a glance. Some computer systems allow file names that contain spaces; others not. The case sensitivity of file names is determined by the file system. Unix file systems are normally case sensitive, and allow user-level applications to create files whose names differ only by whether the characters are uppercase or lowercase. Microsoft Windows recognizes several file systems, each with different policies regarding case sensitivity. The popular old FAT file system can have multiple files whose names differ only in case if the user uses a disk editor to edit the file names in directory entries. User agents, however, will not normally allow the user to create multiple files with the same name but different case letters.
Most computers organize files into hierarchies called folders, directories, or catalogs. (The concept is the same regardless of the terminology used.) Each folder can contain an arbitrary number of files, and can also contain other folders. Other folders can contain still more files and folders, and so on, building up a tree structure in which a "root folder" (the name varies from computer to computer) can contain any number of levels of other folders and files. Folders can be named exactly like files (except for the root folder, which is often unnamed). Using folders makes it easier to organize files in a logical way.
When a computer supports folders, each file and folder not only has its own name, but also a path, which identifies the folder or folders in which a file or folder resides. In the path, some kind of special character - like a slash - is used to separate the names of files and folders. For example, in the illustration shown in this article, the path "/Payroll/Salaries/Managers" uniquely identifies a file called Managers that is in a folder called Salaries that is contained in a folder called Payroll. In this example, the folder and file names are separated by slashes; the parent or root folder has no name, and therefore the path begins with a slash (if the root folder had a name, it would precede this first slash).
Many (but not all) computer systems use filename extensions to help identify what they contain. On Windows computers, extensions consist of a period at the end of the file name, followed by a few letters to identify the file type. An .txt extension identifies a text file; The .doc extension identifies any type of document or documentation, commonly in the Microsoft Office Word file format; etc Even when extensions are used on a computer system, the degree to which a computer system recognizes and deals with them can vary; on some systems they are required, while on other systems they are completely ignored if present.
Operations on entire files
Operations on entire files with the file as the unit, regardless of its records. However, the organization of the file and the logical structure of its records must be taken into account when operating with it.
Creating a file
The purpose of this operation is to allow users to create new files. This operation indicates the properties and characteristics of the file so that the file system can recognize and process it. In the process of creating the file, the necessary information must be recorded so that the system can locate the file and manipulate its logical records. For this, the access method must obtain information about the format and the size of the logical and physical records, the identification of the file, the date of creation, its possible size, its organization, security aspects, etc.
Opening a file
In this operation, the access method locates and identifies an existing file so that users or the operating system itself can operate with it. In some systems the create operation does not exist as such, and it is the file operation of a non-existent file, which implicitly creates a new file. The errors that can occur when opening a file are the following:
- The file is not found in the indicated location (device, directory, name).
- The file has been located but the user has no permission to access it.
- The file cannot be read by errors on the hardware of the storage device.
Closing a file
This operation is used to indicate that a particular file is to be stopped from being used. Using the access method is responsible for "breaking" the connection between the user program and the file, guaranteeing the integrity of the records. When executing this operation, the system is in charge of writing to the storage device the information contained in the buffers associated with the file and the necessary cleaning operations are carried out. After the file is closed, its attributes are no longer accessible to the accessor method. The only parameter required to perform this operation is the file handle returned by the accessor method when creating or opening the file. The errors that can occur when closing a file are the following:
- The file is not open.
- It was not possible to write all of the file information on the device, due to hardware failures.
- It was not possible to write on the device all the file information for lack of space on the storage device.
EXAMPLE To close a file in gedit, select File ▸ Close. Alternatively, you can press the “X” that appears on the right side of the file tab, or press Ctrl + W. Any of these actions will close a file in gedit.
Editing the file
This operation allows user programs to increase the size of a file by allocating more space on the storage device. To perform this operation the access method needs to know the file's identifier and the size of the additional space to allocate to the file. Depending on the organization of the file, the access method will determine whether or not the additional space to allocate should be contiguous to the file. By this operation the attribute indicating the size of the file will be modified and returned to the user program with a status code. The only reason this operation is not successful is because there is not enough space available in the right (non-contiguous) place.
File Protection
Many modern computer systems provide methods to protect files from accidental or intentional damage. Computers that allow multiple users implement file permissions to control who can or cannot read, modify, delete, or create files and folders. A given user can only be granted permission to modify a file or folder, but not to delete it; or a user can be granted permission to create files or folders, but not to delete them. Permissions can also be used to allow only certain users to view the contents of a file or folder. Permissions protect information in files from unauthorized tampering or destruction, and keep private information confidential by preventing unauthorized users from viewing certain files.
Another protection mechanism implemented on many computers is a read-only flag. When this flag is enabled on a file (which can be done 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 should not be changed or deleted, 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 never modify.
File Storage
In physical terms, most computer files are stored on hard drives—magnetic disks that spin inside a computer that can record information indefinitely. Hard drives allow almost instant access to computer files.
A few years ago magnetic tapes used to be used for backup. Other storage media such as recordable compact discs, Zip drives, etc. were also used.
However, flash memories have gained a lot of popularity today, devices with a lot of storage capacity that have the advantage of being small and portable; They are often used to store files on small devices such as mobile phones or portable audio players.
File Backup
When computer files contain information that is extremely important, a back-up process is used to protect against disasters that could 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 were to happen to the computer, or if they were accidentally deleted.
There are many ways to back up files. Most computer systems provide utilities to help with the backup process, which can be time consuming if there are many files to back up. Copying the files to another hard drive on the same computer protects against the failure of one drive, but if it is necessary to protect against the failure or destruction of the entire computer, then copies of the files should be made on another media that can be removed from the computer. computer and stored in a remote and secure location.
File systems and file managers
The way an operating system organizes, names, stores, and manipulates files is collectively referred to as its file system. All operating systems have at least one file system; some operating systems allow you to use several different file systems. For example, in Microsoft Windows 7, they recognize the old FAT and FAT32 file systems from older versions of Windows, in addition to the NTFS file system which is the normal file system in recent versions of Windows. NTFS is not more modern than FAT32; it has been around since Windows NT was released in 1993.
Each file system has its own advantages and disadvantages. Standard FAT only allows eight-byte (or eight 1-byte characters) file names with no spaces (plus a three-byte/character extension), for example, while NTFS allows much longer names that can contain spaces, and have multiple Unicode letters. A file "Payroll Records" on NTFS, while on FAT you would be limited to something like "payroll.dat" (unless you were using VFAT, a FAT extension that allows for long filenames).
File manager programs are utilities that allow you to manipulate files directly. They allow you to move, create, delete, and rename files and folders, although they don't allow you to actually read the contents of a file or store information in it. Every computer system provides at least one file manager program for its native file system. On Windows, the most commonly used file manager is Windows Explorer.
Contenido relacionado
Scalable Vector Graphics
Net on tree
Expert system