rss

Operating systems - Files


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.
This document entitled « Operating systems - Files » 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.
 

Relevant topic found in the forum
30/04 03h22Excel autofilter stops filtering14
10/03 17h31How disable or enable Simple File Sharing XP?6
08/03 20h07File descriptors???2
04/03 17h58Deleting Files from a Flash Drive1
20/06 12h41Files with date stamp1
More discussions about « File »
Software found in the relevant downloads
Download SoftPerfect File Recovery 1.2SoftPerfect File Recovery - SoftPerfect File Recovery is a free and useful tool to restore accidentally deleted files from hard and floppy disks, USB...Category: Backup
License: Freeware/gratuit
Download PC Inspector File Recovery 4.0PC Inspector File Recovery - PC INSPECTORâ„¢ File Recovery is a data recovery program that supports the FAT 12/16/32 and NTFS file systems. Finds...Category: Backup
License: Freeware/gratuit
Download FileZilla Client 3.0.11.1FileZilla Client - Possibilty to download a version compatible with Linux or MacOS <h2> </h2> FileZilla Client is a fast and reliable...Category: FTP
License: Open Source
Download FileZilla Server 0.9.25FileZilla Server - FileZilla Server is an FTP server supports FTP and FTP over SSL/TLS.Category: FTP
License: Open Source
More freeware about « File »