In this article I have briefly looked at how the Operating System(OS) deals with files.
It is a collection of data that is usually stored on a secondary storage device such as a hard disk or floppy diskette.
They are operated on
An OS must provide a number of functions associated with files so that users can safely store and retrieve data.
Normal operation is
Change the name
Additionally, operations on single data elements within a file are supported
File control block
A file control block (FCB), sometimes referred to as a file descriptor, is a data structure that holds information about a file. When an OS needs to access a file, it creates an associated file control block to manage the file.
The structure of file control blocks varies between operating systems, but most file control blocks include the following parts
Location of secondary storage
Date and time or creation or last access
Each OS uses a specific convention or convention for naming them.
MS-DOS uses eight character names, a period, followed by a three-character extension that indicates the file type. File names are not case-sensitive
UNIX file names can be up to 254 characters long and are case-sensitive.
Windows filenames can be up to 255 characters long and are not case-sensitive.
Types refer to the classification of file content such as a program, text, executable program, or data.
In the Windows operating system, the type file name is derived from the extension. Common types and their extensions are:
Basic source program
c source program
Windows applications (programs) associate with specific types. For example, the default application that opens to process a type.txt is the Notepad editor.
How an operating system keeps track of files
A hard disk has a large number of sequentially numbered sectors. As the file is created, free sectors are allocated to hold its contents and are marked as allocated.
To keep track of sectors and whether they are allocated or free and which files they belong to, the OS maintains several tables.
Andoot file system
When the OS is first installed, it creates a root file system on the disk that specifies how many sectors are available and how they will be allocated.
The root file system is a table of entries like a directory. In general, this is a fixed size, and once full, no more entries can be added. Each entry can be a file or another directory table.
The Andoot file system entry
This is highly operating system specific, but an entry might look like this,
Starting cluster number
length in bytes
Date of creation and last modified rights
Permissions (an access control list)