About
A file is a logical representation of multiple block that can be accessed and manipulated at once by a program.
Generally, a file is stored in a durable in the sense that it remains available for programs to use after the current program has finished.
This is also the unit of persistence (meaning that you can't delete a byte in a file, you need to delete a file)
Type
There are three types of files:
Properties
File System attributes
The metadata of a file are called file attributes.
Example of properties / file attributes from the Linux stat utility
File: `testFile.txt'
Size: 4 Blocks: 8 IO Block: 4096 regular file
Device: ca02h/51714d Inode: 2522975 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 500/ oracle) Gid: ( 1001/oinstall)
Access: 2015-09-15 13:50:26.000000000 +0200
Modify: 2015-09-15 12:43:18.000000000 +0200
Change: 2015-09-15 12:43:18.000000000 +0200
Open
List of open files: see IO - Diagnostic/Monitoring
File handles (open file) are scarce, finite resources. Because they are loaded in memory, the maximum number of open file is always a parameter of the file system (Generally in the OS). You can them run out of them if you don't close in your application the stream (ie the in-memory file representation of a file) up properly, just like database connections.
Type
See content type
Management
Delete
File deletion is assumed to be atomic.
When a file is deleted, the deletion is performed on the file system database but not physically on the disk. The space is considered free to use.
Some application can then :
- recover the deleted file
- or remove them completely such as WipeFile (so that there is no way to undelete the files or reconstruct the file content)
Location
The location of a file is given:
- that the file system physically translate to an address on the file store
Glossary
Binary
See binary file