0% found this document useful (0 votes)
34 views6 pages

PT 08 - File Systems

This document discusses file systems and their interfaces. It covers key concepts like file structure, file attributes, file operations, open files, access methods, directory structures, and file types. The objectives are to explain file system functions, interfaces, and design tradeoffs regarding access methods, sharing, locking and directories. File systems provide logical addressing, types of files, and standard operations like create, read, write, delete and more. Directories maintain metadata and allow organization, searching and traversal of files.

Uploaded by

Ninyalobelya
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views6 pages

PT 08 - File Systems

This document discusses file systems and their interfaces. It covers key concepts like file structure, file attributes, file operations, open files, access methods, directory structures, and file types. The objectives are to explain file system functions, interfaces, and design tradeoffs regarding access methods, sharing, locking and directories. File systems provide logical addressing, types of files, and standard operations like create, read, write, delete and more. Directories maintain metadata and allow organization, searching and traversal of files.

Uploaded by

Ninyalobelya
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

7/17/2014

File-System Interface

• File Concept
• Access Methods
• Directory Structure
• File-System Mounting
• File Sharing
File-System Interface • Protection

Objectives File Concept

• To explain the function of file systems • Contiguous logical address space


• To describe the interfaces to file systems • Types:
• To discuss file-system design tradeoffs, – Data
including access methods, file sharing, file • numeric
locking, and directory structures • character
• binary
• To explore file-system protection
– Program

File Structure File Attributes

• None - sequence of words, bytes • Name – only information kept in human-readable form
• Simple record structure • Identifier – unique tag (number) identifies file within file
system
– Lines • Type – needed for systems that support different types
– Fixed length • Location – pointer to file location on device
– Variable length • Size – current file size
• Complex Structures • Protection – controls who can do reading, writing,
– Formatted document executing
• Who decides: • Time, date, and user identification – data for protection,
security, and usage monitoring
– Operating system
• Information about files are kept in the directory structure,
– Program which is maintained on the disk

1
7/17/2014

File Operations Open Files

• File is an abstract data type • Several pieces of data are needed to manage
– Create open files:
– Write – File pointer: pointer to last read/write location,
– Read per process that has the file open
– Reposition within file – File-open count: counter of number of times a file
– Delete is open – to allow removal of data from open-file
– Truncate table when last processes closes it
• Open(Fi) – search the directory structure on disk for – Disk location of the file: cache of data access
entry Fi, and move the content of entry to memory information
• Close (Fi) – move the content of entry Fi in memory – Access rights: per-process access mode
to directory structure on disk information

Open File Locking File Types – Name, Extension

• Provided by some operating systems and


file systems
• Mediates access to a file
• Mandatory or advisory:
– Mandatory – access is denied depending on
locks held and requested
– Advisory – processes can find status of locks
and decide what to do

Access Methods Sequential-access File

• Sequential Access
read next
write next
reset
no read after last write
(rewrite)
• Direct Access
read n
write n
position to n
read next
write next
rewrite n
n = relative block number

2
7/17/2014

Simulation of Sequential Access on Example of Index and Relative Files


Direct-access File

Directory Structure Disk Structure

• A collection of nodes containing information about all files • Disk can be subdivided into partitions
• Disks or partitions can be RAID protected against
Directory failure
• Partitions also known as minidisks, slices
• Entity containing file system known as a volume
• Each volume containing file system also tracks that
file system’s info in device directory or volume
Files table of contents
F2 F4
F1
F3 • As well as general-purpose file systems there are
Fn many special-purpose file systems, frequently all
within the same operating system or computer
Both the directory structure and the files reside on disk
Backups of these two structures are kept on tapes

A Typical File-system Organization Operations Performed on Directory

• Search for a file


• Create a file
• Delete a file
• List a directory
• Rename a file
• Traverse the file system

3
7/17/2014

Organize the Directory


(Logically) to Obtain
Single-Level Directory

• Efficiency – locating a file quickly • A single directory for all users

• Naming – convenient to users


– Two users can have same name for different
files
– The same file can have several different names

• Grouping – logical grouping of files by Naming problem


properties, (e.g., all Java programs, all Grouping problem
games, …)

Two-Level Directory Tree-Structured Directories

• Separate directory for each user

 Path name
 Can have the same file name for different user
 Efficient searching
 No grouping capability

Tree-Structured Directories (Cont.)


Tree-Structured Directories (Cont)

• Absolute or relative path name


• Efficient searching • Creating a new file is done in current directory
• Delete a file
• Grouping Capability rm <file-name>
• Current directory (working directory) • Creating a new subdirectory is done in current
directory
– cd /spell/mail/prog mkdir <dir-name>
Example: if in current directory /mail
– type list mkdir count

mail

prog copy prt exp count

Deleting “mail”  deleting the entire subtree rooted by “mail”

4
7/17/2014

Acyclic-Graph Directories General Graph Directory (Cont.)

• Have shared subdirectories and files • How do we guarantee no cycles?


– Allow only links to file not subdirectories
– Garbage collection
– Every time a new link is added use a cycle
detection algorithm to determine whether it is OK

File Sharing
File Sharing – Multiple Users

• Sharing of files on multi-user systems is • User IDs identify users, allowing


desirable permissions and protections to be per-
• Sharing may be done through a protection user
scheme
• On distributed systems, files may be shared • Group IDs allow users to be in groups,
across a network permitting group access rights
• Network File System (NFS) is a common
distributed file-sharing method

Protection Access Lists and Groups

• Mode of access: read, write, execute


• File owner/creator should be able to control: • Three classes of users
– what can be done a) owner access 7 
RWX
111
RWX
– by whom b) group access 6  110
RWX
c) public access 1  001
• Types of access • Ask manager to create a group (unique name),
– Read say G, and add some users to the group.
– Write • For a particular file (say game) or subdirectory,
– Execute define an appropriate access.
– Append owner group public

– Delete chmod 761 game


– List Attach a group to a file
chgrp G game

5
7/17/2014

Windows XP Access-Control A Sample UNIX Directory Listing


List Management

You might also like