File Management
File Management
Roadmap
Overview
File organisation and Access File Directories File Sharing Secondary Storage Management File System Security
File Management
File management system consists of system utility programs that run as privileged applications Concerned with secondary storage
Typical Operations
File systems also provide functions which can be performed on files, typically:
Create Delete Open Close Read Write
Terms
Four terms are in common use when discussing files:
Field Record File Database
Records
Collection of related fields Treated as a unit
Database
Collection of related data Relationships exist among elements Consists of one or more files
Requirements cont.
5. Each user should be able to move data between files 6. Each user should be able to back up and recover the users files in case of damage 7. Each user should be able to access the users files by using symbolic names
Access Method Accessing records Responsible for all file I/O initiation and termination. Exchanging blocks of data
Roadmap
Overview
File Organization
File Management Referring to the logical structure of records
Physical organization discussed later
Priority will differ depending on the use (e.g. read-only CD vs Hard Drive)
Some may even conflict
The Pile
Data are collected in the order they arrive
No structure
Purpose is to accumulate a mass of data and save it Records may have different fields Record access is by exhaustive search
Indexed File
Uses multiple indexes for different key fields
May contain an exhaustive index that contains one entry for every record in the main file May contain a partial index
When a new record is added to the main file, all of the index files must be updated.
Roadmap
Overview File organisation and Access
File Directories
File Sharing Secondary Storage Management File System Security
Contents
Contains information about files
Attributes Location Ownership
Directory itself is a file owned by the operating system Provides mapping between file names and the files themselves
Directory Elements
Basic Information
Name, Type,
Address Information
Starting address, size used, size allocated, ...
Usage Information
Created date, modified date, accessed date,
Size Allocated
The maximum size of the file
Owner
The owner may be able to grant/deny access to other users and to change these privileges.
Access Information
May include the users name and password for each authorized user.
Permitted Actions
Controls reading, writing, executing, transmitting over a network
Roadmap
Overview File organisation and Access File Directories
File Sharing
Secondary Storage Management File System Security
File Sharing
In multiuser system, allow files to be shared among users Two issues
Access rights Management of simultaneous access
Access Rights
A wide variety of access rights have been used by various systems
None Knowledge Execution Reading Appending/Updating Changing protection Deletion
User Classes
Owner
Usually the files creator, usually has full rights
Specific Users
Rights may be explicitly granted to specific users
User Groups
A set of users identified as a group
All
everyone
Simultaneous Access
User may lock entire file when it is to be updated User may lock the individual records during the update Mutual exclusion and deadlock are issues for shared access
Roadmap
Overview File organisation and Access File Directories File Sharing
3. What data structure should be used to keep track of the file portions?
Portion Size
Two extremes:
Portion large enough to hold entire file is allocated Allocate space one block at a time
Trade-off between efficiency from the point of view of a single file, or the overall system efficiency
Contiguous Allocation
Single set of blocks is allocated to a file at the time of creation Only a single entry in the file allocation table
Starting block and length of the file
External Fragmentation
Chained Allocation
Allocation on basis of individual block Each block contains a pointer to the next block in the chain Only single entry in the file allocation table
Starting block and length of file
Chained Allocation
Indexed Allocation
File allocation table contains a separate one-level index for each file The index has one entry for each portion allocated to the file The file allocation table contains block number for the index
Allocating by blocks eliminates external fragmentation Variable sized blocks improves locality Both cases require occasional consolidation
Bit Tables
This method uses a vector containing one bit for each block on the disk. Each entry of a 0 corresponds to a free block,
and each 1 corresponds to a block in use.
Advantages:
Works well with any file allocation method Small as possible
Indexing
treats free space as a file and uses an index table as it would for file allocation For efficiency, the index should be on the basis of variable-size portions rather than blocks.
Thus, there is one entry in the table for every free portion on the disk.
This approach provides efficient support for all of the file allocation methods.
Roadmap
Overview File organisation and Access File Directories File Sharing Record Blocking Secondary Storage Management
Access Control
By successfully logging on to a system, the user is identified The OS can then enforce rules
Granting access to files and applications (or denying)
Access Matrix
One such rule set is an Access Matrix
Capability Lists
Decomposition by rows yields capability lists (or ticket)
specifies authorized objects and operations for a user.