A filesystem is the methods and data structures that an operating system uses to keep track of files on a disk or partition, that is, the way the files are organized on the disk.
A file is an entry in a directory. The file may have attributes like name, creator, date, type, permissions etc.
A file has various kinds of structure. Some of them can be :
- 1. Simple Record Structure with lines of fixed or variable lengths.
- Complex Structures like formatted document or reloadable load files.
- No Definite Structure like sequence of words and bytes etc.
Attributes of a File:
- Name. It is the only information which is in human-readable form.
- Identifier. The file is identified by a unique tag(number) within file system.
- Type. It is needed for systems that support different types of files.
- Location. Pointer to file location on device.
- Size. The current size of the file.
- Protection. This controls and assigns the power of reading, writing, executing.
File Access Methods:
- Sequential Access:Data is accessed one record right after another is an order.
- Direct Access: There are no restrictions, blocks read/written, can be done in any order.
- Indexed Sequential Access: It uses an Index to control the pointer while accessing files.