1. UNIT – V
FILE MANAGEMENT
PREPARED BY,
V.SANTHI
ASSISTANT PROFESSOR,
DEPARTMENT OF BCA,
BON SECOURS COLLEGE FOR WOMEN,
THANJAVUR.
2. Introduction
File Manager’s efficiency directly affected
by:
How the system’s files are organized
How files are stored
How each file’s records are structured
How user access to all files is protected
2
3. The File Manager
File management system
Software
File access responsibilities
Creating, deleting, modifying, controlling
3
4. Responsibilities of the File
Manager
Four tasks
1.File storage tracking
2. Policy implementation
Determine where and how files are stored
Efficiently use available storage space
Provide efficient file access
3. File allocation if user access cleared
Record file use
4. File Deallocation
Return file to storage
Communicate file availability
4
5. Responsibilities of the File
Manager
Policy determines:
File storage location
System and user access
Uses device-independent commands
Access to material
Two factors
Factor 1: flexibility of access to information
Share files
Provide distributed access
Allow users to browse public directories
5
6. Responsibilities of the File
Manager
Factor 2: subsequent protection
Prevent system malfunctions
Security checks
Account numbers and passwords
File allocation
Activate secondary storage device, load file into
memory, and update records
File deallocation
Update file tables, rewrite file (if revised), and
notify waiting processes of file availability
6
7. Definitions
Field
Group of related bytes
Identified by user (name, type, size)
Record
Group of related fields
File
Group of related records
Information used by specific application
programs
Report generation
Flat file
No connections to other files; no dimensionality
7
8. Definitions
Database
Group of related files
Interconnected at various levels
Give users flexibility of access to stored data
Program files
Contain instructions
Data files
Contain data
Directories (folders)
Listings of filenames and their attributes
8
10. Interacting with the File
Manager
Most common user commands
OPEN, DELETE, RENAME,
COPY
10
11. Interacting with the File
Manager
Device-independent
Physical location: knowledge not needed
Cylinder, surface, sector
Device medium: knowledge not needed
Tape, magnetic disk, optical disc, flash
storage
Network knowledge: not needed
11
12. Interacting with the File
Manager
Logical commands
Broken into lower-level signals
Example: READ
Move read/write heads to record cylinder
Wait for rotational delay (sector containing
record passes under read/write head)
Activate appropriate read/write head and read
record
Transfer record to main memory
Send flag indicating free device for another
request
System monitors for error conditions
12
13. Typical Volume Configuration
Volume
Secondary storage unit (removable,
nonremovable)
Multi-file volume
Contains many files
Multi-volume files
Extremely large files spread across several
volumes
Volume name
File manager manages
Easily accessible
Innermost part of CD, beginning of tape, first
sector of outermost track
13
15. Typical Volume Configuration
Master file directory (MFD)
Stored immediately after volume descriptor
Lists
Names and characteristics of every file in
volume
File names (program files, data files, system
files)
Subdirectories
If supported by file manager
Remainder of volume
Used for file storage 15
16. Typical Volume Configuration
Single directory per volume
Supported by early operating systems
Disadvantages
Long search time for individual file
Directory space filled before disk storage space
filled
Users cannot create subdirectories
Users cannot safeguard their files
Each program needs unique name
Even those serving many users
16
17. Introducing Subdirectories
File managers
Create MFD for each volume
Contains file and subdirectory entries
Subdirectory
Created upon account opening
Treated as file
Flagged in MFD as subdirectory
Unique properties
Improvement over single directory scheme
Problems remain: unable to logically group files
17
18. Introducing Subdirectories
File managers today
Users create own subdirectories (folders)
Related files grouped together
Implemented as upside-down tree
Efficient system searching of individual
directories
May require several directories to reach file
18
20. Introducing Subdirectories
File descriptor
Filename: each must be unique
File type: organization and usage
System dependent
File size: for convenience
File location
Identifies first physical block (or all blocks)
Date and time of creation
Owner
Protection information: access restrictions
Record size: fixed size, maximum size
20
21. File-Naming Conventions
Filename components
Relative filename and extension
Complete filename (absolute filename)
Includes all path information
Relative filename
Name without path information
Appears in directory listings, folders
Provides filename differentiation within directory
Varies in length
One to many characters
Operating system specific
21