Che cos'è un file? O que é único um ficheiro? Was ist eine Datei? Qu'est-ce qu'un fichier? ¿Qué es un archivo?

What is a file?

A file is a suite of binary information, i.e. a suite from 0 to 1. This file may be stored in order to keep a record of this information. A text file is a file comprising characters stored in the form of octets.

This file is saved on the hard drive in the form "name_of_file.ext".
".ext" represents the extension; it is a way of recognizing the type of programme needed to open this file (note: this does not guarantee the file type: when the extension is changed the file type is not changed!).
The length of the name and the extension may vary depending on the operating system:

  • 8 characters for the name and 3 for the extension in DOS and Windows 3.1
  • 256 characters for the name and the extension in Windows 95, 98 and NT
  • 256 in Unix systems

Therefore, in DOS or Windows 3.1, a file from Windows 9x will have a truncated name comprising the first 6 characters of the name followed by ~x where x represents a figure which is increased each time a file carries the same name. This means that if a file name "file~1" already exists, the following will be named "file~2".

Furthermore, a file contains a header which stores additional information such as the file type and in particular the size. It also contains a character at the end of the file meaning that the information after this character no longer belongs to the same file.

You may be asking what is the point of putting the file size in the file header when we already know the size?
Here are two examples that demonstrate the point of this

Corrupted files

You have no doubt downloaded a file on the Internet only to see the browser freeze or the server hosting the file cut off communication.
If the file is a text file you will be missing just the end of the text, but if the file is a binary file (an executable program for example), running it could well be dangerous since information is missing. The operating system thus compares its actual size with the size indicated in the header to check validity of the file. This is generally referred to as integrity. In reality this check is performed using a more powerful algorithm known as CRC (cyclical redundancy check).

Virus infection

When a file is infected with a virus, the virus adds lines of code. Therefore the file size information in the header will no longer be accurate (unless the virus is programmed to change the header) and can be identified.

Last update on Thursday October 16, 2008 02:43:19 PM.This document entitled « What is a file? » from Kioskea (en.kioskea.net) is made available under the Creative Commons license. You can copy, modify copies of this page, under the conditions stipulated by the licence, as this note appears clearly.

Best answers for « What is a file? » in :
File sharing in Windows XP Show Advantages File sharing involves making the content of one or more directories available through the network. All Windows systems have standard devices making it easy to share the content of a directory. However, file sharing may lead to security...
The NTFS file system Show The NTFS file system The NTFS file system (New Technology File System) is based on a structure called the "master file table" or MFT, which is able to hold detailed information on files. This system allows the use of long names, but, unlike the...
How to Password Protect your Files and Folders ShowHow to Password Protect your Files and Folders How to password protect a Word document Password protection on Windows 3.x, Windows 95 and Windows 98 Password protection on Windows XP Password protection on Windows XP Home Edition Password...
How to read a file line by line ShowHow to read a file line by line Intro Tips Bonus Intro One of the most common errors of learning scripts bash on GNU / Linux is to read a file line by line, is to use a loop "for" (for line in $ (cat file.txt) do. ..), which in this...
How to open file .ps (Postscript) ShowHow to open file .ps (Postscript) INTRO Using PDF Creator Using Ghostview INTRO PostScript (PS) is a page programming language used for desktop publishing. Below is a small tips on how to open .ps file. Using PDF...
Download Easy File Locker ShowTo keep your privacy and secure up your data on your machine, the best way is to hide them altogether. Easy File Locker is primarily a tool to block access, modification, reading, deleting, moving or copying your files or folders. But to make...
UNIX - Files ShowIntroduction to UNIX files In UNIX systems any element is represented in the form of a file. All files are architectured around a single tree structure where the base, called the root, is written "/". File types UNIX systems define different...
Graphic filters ShowFiltering Filtering consists in applying a transformation (called a filtre) to all or to part of a digital image by applying an operator. There are the following types of filters: Low-pass filters, which consist in attenuating image components...
The file system ShowWhat is a file system? Even though hard drives can be very small, they still contain millions of bits and therefore need to be organised so that information can be located. This is the purpose of the file system. Remember that a hard drive is made...