

































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Various aspects of file systems in operating systems, including file concepts, access methods, directory structure, file sharing, protection, file systems, file types, file structure, access methods, directory structure, and file operations. It also discusses the unix open() and winnt/2000 createfile() functions, file types and extensions, file structure, sequential and direct access files, index and relative files, file system mounting, file sharing, protection, access lists and groups, and directory design goals.
Typology: Thesis
1 / 41
This page cannot be seen from the preview
Don't miss anything!


































Silberschatz, Galvin and Gagne
File Concept
Access Methods
Directory Structure
File System Mounting
File Sharing
Protection
Silberschatz, Galvin and Gagne
File System consists of
✦
A collection of files
✦
A directory structure
✦
(possibly) partitions
Important Issues
✦
File protection
✦
The semantics of file sharing
Note:Note:Note:Note: Historically, operating systems and filesystems have been viewed as distinct entities.
From the perspective of the modern user, thisdistinction is often blurred.
Silberschatz, Galvin and Gagne
2002
Name
Identifier – a unique tag (i.e., an internal number)that identifies the file within the file system.
Type
Location
Size
Protection
executing.
Time
date
and user identification
security, and usage monitoring.
Information about files are kept in the
directory structure
which is maintained on the disk.
Silberschatz, Galvin and Gagne
Create
Write
Read
Reposition within file – file seek
Delete
Truncate
Open(
i
) – search the directory structure on disk for entry
i
, and move the content of entry to memory.
Close (
i
) – move the content of entry
i
in memory to
directory structure on disk.
Silberschatz, Galvin and Gagne
2002
int fid = open(“blah”, flags);read(fid, …);
stdinstdoutstderr ...
File Structure
File
Descriptor
(whereblocks are)
(attributes)
(index)
(Per process)
(Per device)
Silberschatz, Galvin and Gagne
CreateFile
lpFileName
// name of file
dwDesiredAccess
// read-write
dwShareMode
// shared or not
lpSecurity
// permissions
Silberschatz, Galvin and Gagne
File types may be used to indicate the internalstructure of a file.
An OS may require
require
require require a file to have a specific structure
so that the OS will provide special operations for thosefiles conforming to the set of system-supported filestructures.
✦
e.g., VMS supported three defined file structures.
✦
Others (UNIX, MS-DOS) support a minimal
minimalminimalminimal number of file
structures.
This is an obvious tradeoff between flexibility andsystem support!
Silberschatz, Galvin and Gagne
Access methods determine the way that files areaccessed and read into memory.
Some systems only
only
only only support one access method while
other OS’s support many access methods.
Sequential Access
✦
The most common method used by editors andcompilers.
✦
Information is processed in order.
read nextwrite nextreset no
read after last write
(rewrite)
Silberschatz, Galvin and Gagne
File is made up of fixed-length logical records thatallow programs to read and write records in noparticular order.
The files is viewed as a numbered sequence ofblocks or records.
Very useful in databases.
Direct Access
n
= relative block number}
read nwrite nposition to n
read nextwrite next
rewrite n
Silberschatz, Galvin and Gagne
Simulation of Sequential Access on a Direct-access File
Silberschatz, Galvin and Gagne
Partitions (or Volumes) – can be viewed as theabstraction of virtual disks.
virtual disks.virtual disks.virtual disks.
Disks can be partitioned into separate areas such thateach partition is treated as a separate storage device.
The other way --
a partition may be defined to be more
moremoremore
than onethan onethan onethan one disk device.
Partitions can store multiple
multiple
multiple multiple operating systems such that
a system can boot more than one OS.
Each partition contains information about files in adevice directorydevice directorydevice directorydevice directory (or a VTOC
VTOCVTOCVTOC – Volume Table of Contents).
Each directory records file attribute information.
Silberschatz, Galvin and Gagne
A collection of nodes containing information about allfiles.
F 1
F 2
F 3
F 4
F n
Directory
Files
Both the directory structure and the files reside on disk.Backups of these two structures are kept on tapes.
Silberschatz, Galvin and Gagne
Name
Type
Address
Current length
Maximum length
Date last accessed (for archival)
Date last updated (for dump)
Owner ID (who pays)
Protection information (discuss later)
Silberschatz, Galvin and Gagne
Search for a file
- need to find a particular entry or
be able to find file names based on a pattern match.
Create a file -
and add
add
add add its entry to the directory.
Delete a file
- and remove
remove
remove remove it from the directory.
List a directory –
list both the files in the directory
and the directory contents for each file.
Rename a file –
renaming may imply changing the
position of the file entry in the directory structure.
Traverse the file system –
the directory needs a logical
structure such that every directory and every filewithin each directory can be accessing efficiently.
efficiently.efficiently.efficiently.