FILE MANAGEMENT
·
File management is the process of storing,
controlling and managing data stored on disks or secondary storage in the form
of files.
·
File management ensures the consistency of data
when multiple users access files concurrently.
·
File management also provides the measures for
file security and protection.
FILE CONCEPT
·
A file is a logical collection of information
stored on secondary storage such as hard disk.
·
Physically, a file is the smallest allotment of
secondary storage device e.g. disk. Logically, a file is a sequence of logical
records ie. a sequence of bits and bytes.
·
Files can be used to contain data and programs
(both source and object program).
·
Data files can be numeric, alphabetic,
alphanumeric or binary.
·
A file has various attributes like name, type,
location, size, protection, time and date of creation etc.
1. File
Naming
·
A file can be given a name for the convenience
of its use by its creator.
·
A name is attached to every file so as to uniquely
identify it and access it through its name.
·
The exact rules for naming file vary from system
to system but all the operating systems allow string of one to eight letters as
legal file name.
·
Digits and few special characters are also
allowed in file names.
·
Some systems differentiate between uppercase and
lower case characters in names, whereas other systems consider the two cases
equivalent. For example, UNIX differentiate uppercase letters from the
lowercase whereas MS-DOS does not.
·
Thus in UNIX, files-HELLO, hello, Hello and
HEllo are different whereas in MS-DOS, they all represent same file.
2. File
attributes
·
File attributes are required by file management
system to manage a file.
·
Few attributes are accessible for users, such as
access privileges, name, or size of a file, whereas some of them are
specifically assigned to file for file system usage .
·
File attributes vary from one operating system
to other. The various file attributes are listed in fig. 9.1 No existing system
has all of these, but each one is present in some system.
·
The first four attributes shown in table are
related to file protection and tell who may access it and who may not.
·
The flags are bits or short fields that enable
or control some specific property:
1.
Hidden flag. Hidden files do not appear in the listing of a
file.
2.
Archive flag. Archive flag bit keeps
track of whether the file has been backed up.
3.
Temporary flag. This flag allows a file
to be marked for automatic deletion when the process that created it
terminates.
·
The various times keep tract of when the file
was created, most recently used and most recently modifies.
·
The current size attribute tells how big a file
is at present.
·
The maximum size attribute tells the maximum
amount of storage reserved for a file in advance. It is used for mainframe
operating systems and not in minicomputers and personal computer systems.
SNO.
|
Field
|
Meaning
|
1
|
Protection
|
Who can access a file and in what way ( reading, writing, executing).
|
2
|
Password
|
Password needed to access a file.
|
3
|
Creator
|
ID of a person who created a file
|
4
|
Owner
|
Current owner of a file
|
5
|
Read – Only flag
|
Zero for read/write , 1 for read only
|
6
|
Hidden flag
|
Zero for normal , 1 for do not display in listings
|
7
|
System flag
|
0 for normal file, 1 for system file
|
8
|
Archive flag
|
0 has been backed up, 1 for needs to be backed up.
|
9
|
ASCII/Binary flag
|
0 for ASCII file , 1for binary file
|
10
|
Random access flag
|
0 for sequential access only, 1 for random access.
|
11
|
Temporary flag
|
0 for normal , 1 for delete on process exit.
|
12
|
Lock flag
|
0 for unlocked , non zero for
locked
|
13
|
Creation time
|
Date and time of file was created .
|
14
|
Time of last access
|
Date and time file was last accessed
|
15
|
Time of last change
|
Date and time file was last changed
|
16
|
Current size
|
Number of bytes in a file
|
17
|
Maximum size
|
Maximum size file may grow to
|
No comments:
Post a Comment