Computer Fundamental
Computer Tutorial

File Management



File Management

» The file management function of the operating system involves handling the file system which consists of two parts—a set of files, and a directory structure.
» File is a collection of related information, has a name, and is stored on a secondary storage. It is the smallest named unit that can be written to a secondary storage device. Data cannot be stored on the secondary storage if it is not in the form of a file. A file has attributes like its name, location, size, type, time, and date of creation etc. The information stored in a file can be accessed in different ways—sequential access (access is in a sequential order from start to end) and direct access (the file can be accessed in any order).
» Directory structure provides information about the files stored on the secondary storage. Directory contains information about all the files within it. The information about the files is kept as entries in the directory of device. A directory further may have a subdirectory defined within it. Directory contains the name, location, size, and type of all the files defined on the device. The tree-structured directory is the commonly used directory structure.

» The operating system manages the storage media like the disk and implements the abstract concept of the file. System calls are an interface between the process and the operating system. Operating system provides system calls for creating, reading, writing, deleting, repositioning, and truncating a file. Some of the operations that can be performed on a directory are—search for a file, create, delete and rename a file, list a directory, and traverse the file system within the directory. The user simply uses the system calls like “dir”, “list” to perform operation on a file or directory, without going into the details of its working.