Beruflich Dokumente
Kultur Dokumente
Fifth Edition
Chapter 8
File Management
File allocation
Activate secondary storage device, load file into
memory, update records
File deallocation
Update file tables, rewrite file (if revised), notify
waiting processes of file availability
Understanding Operating Systems, Fifth Edition
Definitions
Field
Group of related bytes (e.g. last_name, first_name,
age) that can be identified by the user with a name,
type, and size.
Record
Group of related fields
File
Group of related records that contains information to
be used by specific application programs to generate
reports. This type of file contains data and is
sometimes called a flat file because it has no
connections to other files and has no dimensionality.
Understanding Operating Systems, Fifth Edition
Definitions (continued)
Databases
Groups of related files
Interconnected at various levels
Give users flexibility of access to stored data
Program files
Contain instructions
Data files
Contain data
Directories
Are special files with listings of filenames and their
attributes
Understanding Operating Systems, Fifth Edition
Definitions (continued)
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
Understanding Operating Systems, Fifth Edition
10
File Manager does all of this and performs error checking and
correction
No need for error-checking code in programs
Understanding Operating Systems, Fifth Edition
11
12
13
Any subdirectories
If supported by file manager
14
Disadvantages
15
About Subdirectories
Newer File Managers
Create MFD for each volume
Contains file and subdirectory entries
Improvement over single directory scheme
Problems remain: users unable to logically group files by
creating their own subdirectories.
Subdirectory
Is created when a user opens an account in the computer
system
Is treated as a file
Though flagged in MFD as subdirectory
Has unique properties since its records are filenames
pointing to files
Understanding Operating Systems, Fifth Edition
16
17
18
19
File-Naming Conventions
Filename components
Relative filename and extension
Relative filename
20
Example
BASIA_TUNE.MPG
Unknown extension
Requires user intervention
21
22
UNIX/Linux
Forward slash (root), first subdirectory, subsubdirectory, files relative name
23
File Organization
Arrangement of records within files
All files composed of records
Modify command
Request to access record within a file
24
Record Format
Fixed-length records
Easiest to access directly
The record size is critical
Ideal for data files
Variable-length records
25
26
27
Special files
28
Text files
Character strings
Lines delimited by line feed or new line character
Binary files
Sequences of binary digits (bits)
Grouped into words as they appear in memory during
program execution
Structure of files
Controlled by programs using them and not by UNIX
Understanding Operating Systems, Fifth Edition
29
30
Owners identification
Protection bits, physical address, file size
Time of creation, last use, and last update
Number of links
File type
Directory, ordinary file, or special file
31
33
34
35
36
Aliases (links)
Important UNIX feature: support file sharing
Several users work together on same project
37
38
i-node
Contains rest of information
39
40
41
42