Professional Documents
Culture Documents
File Management
File Management
File Management
CHAPETER 8
The File manager
• The File Manager (also called the file management system) is the
software responsible for creating, deleting, modifying, and
controlling access to files—as well as for managing the resources
used by the file.
Responsibilities of the File Manager
1. Keep track of where each file is stored.
2. Use a policy that will determine where and how the files will be stored,
making sure to efficiently use the available storage space and provide efficient
access to the files.
3. Allocate each file when a user has been cleared for access to it, then record
its use.
4. Deallocate the file when the file is to be returned to storage, and
communicate its availability to others who may be waiting for it
In a computer system, the File Manager keeps track of its files with
directories that contain the filename, its physical location in secondary
storage, and important information about each file
The computer system allocates a file by activating the appropriate
secondary storage device and loading the file into memory while updating its
records of who is using what file. Finally, the File Manager deallocates a file by
updating the file tables and rewriting the file (if revised) to the secondary
storage device. Any processes waiting to access the file are then notified of its
availability
• A field is a group of related bytes that can be identified by the user with a name, type, and size.
• A record is a group of related fields.
• A file is a group of related records that contains information to be used by specific application
programs to generate reports.
• A database appears to the File Manager to be a type of file, but databases are more complex
because they’re actually groups of related files that are interconnected at various levels to give users
flexibility of access to the data stored.
• Program files contain instructions and data files contain data; but as far as storage is concerned, the
File Manager treats them exactly the same way.
• Directories are special files with listings of filenames and their attributes.
Interacting With The File Manager
• File Managers create an MFD for each volume that can contain entries for
both files and subdirectories. A subdirectory is created when a user opens an
account to access the computer system.
• Each file entry in every directory contains information describing the file; it’s
called the file descriptor.
Information typically included in a file descriptor includes the following:
Linux:
/usr/imfst/flynn/inventory_cost.doc
FILE ORGANIZATION
When data is stored in Variable-Length record format, the size expands to fit the contents
but it takes longer to access it. Different records in the file have different sizes; memory efficient;
access of the records is slower.
File organization refers to the
relationship of the key of the record
to the physical location of that
record in the computer file. File
organization may be either physical
file or a logical file. A physical file is
a physical unit, such as magnetic
tape or a disk.
Types of
File Organizations
• Sequential File Organization.
Heap File Organization.
Hash File Organization.
B+ Tree File Organization.
Clustered FileOrganization.
• Sequential File Organization
• A sequential file contains records organized by the
order in which they were entered. The order of the
records is fixed. Records in sequential files can be read
or written only sequentially. After you place a record
into a sequential file, you cannot shorten, lengthen, or
delete the record.
Heap File Organization.
• It is the simplest and most basic type of organization. It works
with data blocks. In heap file organization, the records are
inserted at the file's end. When the records are inserted, it
doesn't require the sorting and ordering of records.
• Hash File Organization.
• Hash File Organization uses the computation of hash function on
some fields of the records. The hash function's output determines the
location of disk block where the records are to be placed.
B+ Tree File Organization
• B+ tree file organization is the advanced method of an
indexed sequential access method. It uses a tree-like
structure to store records in File.
• The B+ tree is similar to a binary search tree (BST), but it
can have more than two children. In this method, all the
records are stored only at the leaf node. Intermediate nodes
act as a pointer to the leaf nodes. They do not contain any
records.
Clustered FileOrganization.
• The cluster file organization is used when there is a frequent need
for joining the tables with the same condition. These joins will give
only a few records from both tables. In the given example, we are
retrieving the record for only particular departments. This method
can't be used to retrieve the record for the entire department.