File Management
File Management
File system – concerned with managing secondary storage space particularly disk storage. It consists of
two distinct parts:
A collection of files each storing related data
A directory structure which organizes and provide information about all the files in the system.
A file – is a named collection of related information that is recorded on secondary storage.
File Naming
A file is named for convenience of its human users and a name is usually a string of characters e.g.
“good.c”. When a file is named it becomes independent of the process, the user and even the system that
created it i.e. another user may edit the same file and specify a different name.
File Types
An o/s should recognize and support different files types so that it can operate and file in reasonable
ways.
Files types can be implemented by including it as part of file name. The name is split into 2 parts – a
name and extension usually separated by a period character. The extension indicates the type of file and
type of operations that can be on that file.
File Attributes
A part fro the name other attributes of files include
Size – amount of information stored in the file
Location – Is a pointer to a device and to the location of file on the device
Protection – Access control to information in file (who can read, write, execute and so on)
Time, Date and user identification –This information is kept for creation, last modification and
last use. These data can be useful for protection, security and usage monitor.
Volatility – frequency with which additions and deletions are made to a file
Activity – Refers to the percentage of file’s records accessed during a given period of time.
File Operations
File can be manipulated by operations such as:
Open – prepare a file to be referenced
Close – prevent further reference to a file until it is reopened
Create – Build a new file
Destroy – Remove a file
Copy – create another version of file with a new name.
Rename – change name of a file.
List – Print or display contents.
Move – change location of file
Individual data items within the file may be manipulated by operations like:
Read – Input a data tem to a process from a file
Write – Output a data item from a process to a file
Update – modify an existing data item in a file
Insert – Add a new data item to a file
Delete – Remove a data item to a file
Truncating – delete some data items but file retains all other attributes
File Structure
Refers to internal organization of the file. File types may indicate structure. Certain files must conform to
a required structure that is understood by the o/s. Some o/s have file systems that does support multiple
structure while others impose (and support) a minimal number of file structures e.g. MS DOS and UNIX.
UNIX considers ach file to be a sequence of 8-bit bytes. Macintosh o/s supports a minimal no of file
structure and it expects executables to contain 2 parts – a resource fork and a data fork. Resource fork
contains information of importance to user e.g. labels of any buttons displayed by program.
File Organization
Refers to the manner in which records f a file are arranged on secondary storage.
The most popular schemes are:-
a) Sequential
Records placed in physical order. The next record is the one that physically follows the previous record. It
is used for records in magnetic tape.
b) Direct
Records are directly (randomly) accessed by their physical addresses on a direct Access by storage device
(DASD). The application user places the records on DASD in any order appropriate for a particular
application.
c) Indexed Sequential
Records are arranged in logical sequence according to a key contained in each record. The system
maintains an index containing the physical addresses of certain principal records. Indexed sequential
records may be accessed sequentially in key order or they may be accessed directly by a search through
the system created index. It is usually used inn disk.
d) Partitioned
It is a file of sequential sub files. Each sequential sub file is called a member. The starting address of each
member is stored in the file directory. Partitioned files are often used to store program libraries.
File Sharing
In a multi user system there is almost a requirement for allowing files to be shared among a number of
users. Two issues arise:-
i) Access rights – should provide a number of options so that the way in which a particular file is
accessed can be controlled. Access rights assigned to a particular file include: Read, execute,
append, update, delete.
ii) Simultaneous access – a discipline is required when access is granted to append or update a file to
more than one user. An approach can allow a user to lock the entire file when it is to be updated.