nAll Computer applications need to store and retrieve information
nWhile a process is running, it can store a limited amount of information within its address space.
nFor some applications file size is adequate but for most of the applications like banking, corporate record keeping, it is very small.
nApart from this there are other problems with keeping information within a process address space
1.When the process terminates the information is lost, while the database applications require that information need to be retained
2.It is frequently necessary for multiple processes to access the information at the same time, but if information is stored inside the address space then only that process can access that information
3.Process can store limited amount of information in its address space
nThus we have three essential requirements for long-term information storage:
qIt must be possible to store a very large amount of information.
qThe information must survive the termination of the process using it
qMultiple processes must be able to access the information concurrently
nThe usual solution to all these problems is to store information on disks and other external media is called file.
nA file is a named collection of related information that is recorded on the secondary storage.
nInformation stored in files must be persistent i.e. not to be affected by process creation or termination
nFiles are managed by OS. How they are structured, named, accessed, used, protected and implemented are major topics in OS design
nPart of the OS deals with file is known as file system.
nFiles are abstraction mechanism
qThey provide a way to store information on the disk and read it back later.
qHow and where the information is stored, and how the disks actually work, is hidden from the user.
nThe most important of any mechanism is naming.
nWhen a process creates a file, it gives the file a name.
nWhen the process terminates, the file continues to exist, and can be accessed by other processes using its name.
nRules vary from system to system
q1 to 8 letters as legal file names
qDigits and special characters are also permitted
qSome file systems differentiate between upper case letters and lower case letters
qURGENT, urgent, Urgent, URgent, UrGent are treated as different file names
nMS-DOS does not differentiate
qAll are same