SlideShare a Scribd company logo
1 of 42
Chapter 10: File-System InterfaceChapter 10: File-System Interface
10.2 Silberschatz, Galvin and GagneOperating System Concepts
Chapter 10: File-System InterfaceChapter 10: File-System Interface
File Concept
Access Methods
Directory Structure
File-System Mounting
File Sharing
Protection
10.3 Silberschatz, Galvin and GagneOperating System Concepts
ObjectivesObjectives
To explain the function of file systems
To describe the interfaces to file systems
To discuss file-system design tradeoffs, including access methods,
file sharing, file locking, and directory structures
To explore file-system protection
10.4 Silberschatz, Galvin and GagneOperating System Concepts
File ConceptFile Concept
Contiguous logical address space
Types:
Data
 numeric
 character
 binary
Program
10.5 Silberschatz, Galvin and GagneOperating System Concepts
File StructureFile Structure
None - sequence of words, bytes
Simple record structure
Lines
Fixed length
Variable length
Complex Structures
Formatted document
Relocatable load file
Can simulate last two with first method by inserting appropriate
control characters
Who decides:
Operating system
Program
10.6 Silberschatz, Galvin and GagneOperating System Concepts
File AttributesFile Attributes
Name – only information kept in human-readable form
Identifier – unique tag (number) identifies file within file system
Type – needed for systems that support different types
Location – pointer to file location on device
Size – current file size
Protection – controls who can do reading, writing, executing
Time, date, and user identification – data for protection,
security, and usage monitoring
Information about files are kept in the directory structure, which is
maintained on the disk
10.7 Silberschatz, Galvin and GagneOperating System Concepts
File OperationsFile Operations
File is an abstract data type
Create
Write
Read
Reposition within file
Delete
Truncate
Open(Fi) – search the directory structure on disk for entry Fi, and
move the content of entry to memory
Close (Fi) – move the content of entry Fi in memory to directory
structure on disk
10.8 Silberschatz, Galvin and GagneOperating System Concepts
Open FilesOpen Files
Several pieces of data are needed to manage open files:
File pointer: pointer to last read/write location, per process that
has the file open
File-open count: counter of number of times a file is open – to
allow removal of data from open-file table when last processes
closes it
Disk location of the file: cache of data access information
Access rights: per-process access mode information
10.9 Silberschatz, Galvin and GagneOperating System Concepts
Open File LockingOpen File Locking
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
10.10 Silberschatz, Galvin and GagneOperating System Concepts
File Locking Example – Java APIFile Locking Example – Java API
import java.io.*;
import java.nio.channels.*;
public class LockingExample {
public static final boolean EXCLUSIVE = false;
public static final boolean SHARED = true;
public static void main(String arsg[]) throws IOException {
FileLock sharedLock = null;
FileLock exclusiveLock = null;
try {
RandomAccessFile raf = new RandomAccessFile("file.txt", "rw");
// get the channel for the file
FileChannel ch = raf.getChannel();
// this locks the first half of the file - exclusive
exclusiveLock = ch.lock(0, raf.length()/2, EXCLUSIVE);
/** Now modify the data . . . */
// release the lock
exclusiveLock.release();
10.11 Silberschatz, Galvin and GagneOperating System Concepts
File Locking Example – Java APIFile Locking Example – Java API
(cont)(cont)
// this locks the second half of the file - shared
sharedLock = ch.lock(raf.length()/2+1, raf.length(),
SHARED);
/** Now read the data . . . */
// release the lock
exclusiveLock.release();
} catch (java.io.IOException ioe) {
System.err.println(ioe);
}finally {
if (exclusiveLock != null)
exclusiveLock.release();
if (sharedLock != null)
sharedLock.release();
}
}
}
10.12 Silberschatz, Galvin and GagneOperating System Concepts
File Types – Name, ExtensionFile Types – Name, Extension
10.13 Silberschatz, Galvin and GagneOperating System Concepts
Access MethodsAccess Methods
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
10.14 Silberschatz, Galvin and GagneOperating System Concepts
Sequential-access FileSequential-access File
10.15 Silberschatz, Galvin and GagneOperating System Concepts
Simulation of Sequential Access on a Direct-accessSimulation of Sequential Access on a Direct-access
FileFile
10.16 Silberschatz, Galvin and GagneOperating System Concepts
Example of Index and Relative FilesExample of Index and Relative Files
10.17 Silberschatz, Galvin and GagneOperating System Concepts
Directory StructureDirectory Structure
A collection of nodes containing information about all files
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
10.18 Silberschatz, Galvin and GagneOperating System Concepts
A Typical File-system OrganizationA Typical File-system Organization
10.19 Silberschatz, Galvin and GagneOperating System Concepts
Operations Performed on DirectoryOperations Performed on Directory
Search for a file
Create a file
Delete a file
List a directory
Rename a file
Traverse the file system
10.20 Silberschatz, Galvin and GagneOperating System Concepts
Organize the Directory (Logically) toOrganize the Directory (Logically) to
ObtainObtain
Efficiency – locating a file quickly
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 properties, (e.g., all
Java programs, all games, …)
10.21 Silberschatz, Galvin and GagneOperating System Concepts
Single-Level DirectorySingle-Level Directory
A single directory for all users
Naming problem
Grouping problem
10.22 Silberschatz, Galvin and GagneOperating System Concepts
Two-Level DirectoryTwo-Level Directory
Separate directory for each user
Path name
Can have the same file name for different user
Efficient searching
No grouping capability
10.23 Silberschatz, Galvin and GagneOperating System Concepts
Tree-Structured DirectoriesTree-Structured Directories
10.24 Silberschatz, Galvin and GagneOperating System Concepts
Tree-Structured Directories (Cont)Tree-Structured Directories (Cont)
Efficient searching
Grouping Capability
Current directory (working directory)
cd /spell/mail/prog
type list
10.25 Silberschatz, Galvin and GagneOperating System Concepts
Tree-Structured Directories (Cont)Tree-Structured Directories (Cont)
Absolute or relative path name
Creating a new file is done in current directory
Delete a file
rm <file-name>
Creating a new subdirectory is done in current directory
mkdir <dir-name>
Example: if in current directory /mail
mkdir count
mail
prog copy prt exp count
Deleting “mail” ⇒ deleting the entire subtree rooted by “mail”
10.26 Silberschatz, Galvin and GagneOperating System Concepts
Acyclic-Graph DirectoriesAcyclic-Graph Directories
Have shared subdirectories and files
10.27 Silberschatz, Galvin and GagneOperating System Concepts
Acyclic-Graph Directories (Cont.)Acyclic-Graph Directories (Cont.)
Two different names (aliasing)
If dict deletes list ⇒ dangling pointer
Solutions:
Backpointers, so we can delete all pointers
Variable size records a problem
Backpointers using a daisy chain organization
Entry-hold-count solution
New directory entry type
Link – another name (pointer) to an existing file
Resolve the link – follow pointer to locate the file
10.28 Silberschatz, Galvin and GagneOperating System Concepts
General Graph DirectoryGeneral Graph Directory
10.29 Silberschatz, Galvin and GagneOperating System Concepts
General Graph Directory (Cont.)General Graph Directory (Cont.)
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
10.30 Silberschatz, Galvin and GagneOperating System Concepts
File System MountingFile System Mounting
A file system must be mounted before it can be
accessed
A unmounted file system (i.e. Fig. 11-11(b)) is mounted
at a mount point
10.31 Silberschatz, Galvin and GagneOperating System Concepts
(a) Existing. (b) Unmounted(a) Existing. (b) Unmounted
PartitionPartition
10.32 Silberschatz, Galvin and GagneOperating System Concepts
Mount PointMount Point
10.33 Silberschatz, Galvin and GagneOperating System Concepts
File SharingFile Sharing
Sharing of files on multi-user systems is desirable
Sharing may be done through a protection scheme
On distributed systems, files may be shared across a network
Network File System (NFS) is a common distributed file-sharing
method
10.34 Silberschatz, Galvin and GagneOperating System Concepts
File Sharing – Multiple UsersFile Sharing – Multiple Users
User IDs identify users, allowing permissions and
protections to be per-user
Group IDs allow users to be in groups, permitting group
access rights
10.35 Silberschatz, Galvin and GagneOperating System Concepts
File Sharing – Remote File SystemsFile Sharing – Remote File Systems
Uses networking to allow file system access between systems
Manually via programs like FTP
Automatically, seamlessly using distributed file systems
Semi automatically via the world wide web
Client-server model allows clients to mount remote file systems
from servers
Server can serve multiple clients
Client and user-on-client identification is insecure or
complicated
NFS is standard UNIX client-server file sharing protocol
CIFS is standard Windows protocol
Standard operating system file calls are translated into remote
calls
Distributed Information Systems (distributed naming services)
such as LDAP, DNS, NIS, Active Directory implement unified
access to information needed for remote computing
10.36 Silberschatz, Galvin and GagneOperating System Concepts
File Sharing – Failure ModesFile Sharing – Failure Modes
Remote file systems add new failure modes, due to network
failure, server failure
Recovery from failure can involve state information about
status of each remote request
Stateless protocols such as NFS include all information in
each request, allowing easy recovery but less security
10.37 Silberschatz, Galvin and GagneOperating System Concepts
File Sharing – ConsistencyFile Sharing – Consistency
SemanticsSemantics
Consistency semantics specify how multiple users are to
access a shared file simultaneously
Similar to Ch 7 process synchronization algorithms
 Tend to be less complex due to disk I/O and network
latency (for remote file systems
Andrew File System (AFS) implemented complex remote file
sharing semantics
Unix file system (UFS) implements:
 Writes to an open file visible immediately to other users of
the same open file
 Sharing file pointer to allow multiple users to read and write
concurrently
AFS has session semantics
 Writes only visible to sessions starting after the file is closed
10.38 Silberschatz, Galvin and GagneOperating System Concepts
ProtectionProtection
File owner/creator should be able to control:
what can be done
by whom
Types of access
Read
Write
Execute
Append
Delete
List
10.39 Silberschatz, Galvin and GagneOperating System Concepts
Access Lists and GroupsAccess Lists and Groups
Mode of access: read, write, execute
Three classes of users
RWX
a) owner access 7 ⇒ 1 1 1
RWX
b) group access 6 ⇒ 1 1 0
RWX
c) public access 1 ⇒ 0 0 1
Ask manager to create a group (unique name), say G, and add
some users to the group.
For a particular file (say game) or subdirectory, define an
appropriate access.
owner group public
chmod 761 game
Attach a group to a file
chgrp G game
10.40 Silberschatz, Galvin and GagneOperating System Concepts
Windows XP Access-control List
ManagementManagement
10.41 Silberschatz, Galvin and GagneOperating System Concepts
A Sample UNIX Directory ListingA Sample UNIX Directory Listing
End of Chapter 10End of Chapter 10

More Related Content

What's hot

Ch12 OS
Ch12 OSCh12 OS
Ch12 OSC.U
 
Distributed File Systems: An Overview
Distributed File Systems: An OverviewDistributed File Systems: An Overview
Distributed File Systems: An OverviewAnant Narayanan
 
Distributed file system
Distributed file systemDistributed file system
Distributed file systemJanani S
 
Hadoop Distributed File System
Hadoop Distributed File SystemHadoop Distributed File System
Hadoop Distributed File SystemMilad Sobhkhiz
 
Distributed file systems
Distributed file systemsDistributed file systems
Distributed file systemsSri Prasanna
 
Self-Adapting, Energy-Conserving Distributed File Systems
Self-Adapting, Energy-Conserving Distributed File SystemsSelf-Adapting, Energy-Conserving Distributed File Systems
Self-Adapting, Energy-Conserving Distributed File SystemsMário Almeida
 
Dfs (Distributed computing)
Dfs (Distributed computing)Dfs (Distributed computing)
Dfs (Distributed computing)Sri Prasanna
 
Distributed File Systems
Distributed File SystemsDistributed File Systems
Distributed File Systemsawesomesos
 
Introduction to distributed file systems
Introduction to distributed file systemsIntroduction to distributed file systems
Introduction to distributed file systemsViet-Trung TRAN
 
Distributed file system
Distributed file systemDistributed file system
Distributed file systemNaza hamed Jan
 
Distributed File Systems
Distributed File Systems Distributed File Systems
Distributed File Systems Maurvi04
 
3. distributed file system requirements
3. distributed file system requirements3. distributed file system requirements
3. distributed file system requirementsAbDul ThaYyal
 
Active directory installation windows 2003 1
Active directory installation windows 2003 1Active directory installation windows 2003 1
Active directory installation windows 2003 1tameemyousaf
 
Distribution File System DFS Technologies
Distribution File System DFS TechnologiesDistribution File System DFS Technologies
Distribution File System DFS TechnologiesRaphael Ejike
 
Chapter 17 - Distributed File Systems
Chapter 17 - Distributed File SystemsChapter 17 - Distributed File Systems
Chapter 17 - Distributed File SystemsWayne Jones Jnr
 
4.file service architecture (1)
4.file service architecture (1)4.file service architecture (1)
4.file service architecture (1)AbDul ThaYyal
 
file sharing semantics by Umar Danjuma Maiwada
file sharing semantics by Umar Danjuma Maiwada file sharing semantics by Umar Danjuma Maiwada
file sharing semantics by Umar Danjuma Maiwada umardanjumamaiwada
 
File models and file accessing models
File models and file accessing modelsFile models and file accessing models
File models and file accessing modelsishmecse13
 
Server interview[1]
Server interview[1]Server interview[1]
Server interview[1]sourav nanda
 

What's hot (20)

Ch12 OS
Ch12 OSCh12 OS
Ch12 OS
 
Distributed File Systems: An Overview
Distributed File Systems: An OverviewDistributed File Systems: An Overview
Distributed File Systems: An Overview
 
Distributed file system
Distributed file systemDistributed file system
Distributed file system
 
Hadoop Distributed File System
Hadoop Distributed File SystemHadoop Distributed File System
Hadoop Distributed File System
 
Distributed file systems
Distributed file systemsDistributed file systems
Distributed file systems
 
Self-Adapting, Energy-Conserving Distributed File Systems
Self-Adapting, Energy-Conserving Distributed File SystemsSelf-Adapting, Energy-Conserving Distributed File Systems
Self-Adapting, Energy-Conserving Distributed File Systems
 
Dfs (Distributed computing)
Dfs (Distributed computing)Dfs (Distributed computing)
Dfs (Distributed computing)
 
Distributed File Systems
Distributed File SystemsDistributed File Systems
Distributed File Systems
 
Introduction to distributed file systems
Introduction to distributed file systemsIntroduction to distributed file systems
Introduction to distributed file systems
 
Distributed file system
Distributed file systemDistributed file system
Distributed file system
 
Distributed File Systems
Distributed File Systems Distributed File Systems
Distributed File Systems
 
12. dfs
12. dfs12. dfs
12. dfs
 
3. distributed file system requirements
3. distributed file system requirements3. distributed file system requirements
3. distributed file system requirements
 
Active directory installation windows 2003 1
Active directory installation windows 2003 1Active directory installation windows 2003 1
Active directory installation windows 2003 1
 
Distribution File System DFS Technologies
Distribution File System DFS TechnologiesDistribution File System DFS Technologies
Distribution File System DFS Technologies
 
Chapter 17 - Distributed File Systems
Chapter 17 - Distributed File SystemsChapter 17 - Distributed File Systems
Chapter 17 - Distributed File Systems
 
4.file service architecture (1)
4.file service architecture (1)4.file service architecture (1)
4.file service architecture (1)
 
file sharing semantics by Umar Danjuma Maiwada
file sharing semantics by Umar Danjuma Maiwada file sharing semantics by Umar Danjuma Maiwada
file sharing semantics by Umar Danjuma Maiwada
 
File models and file accessing models
File models and file accessing modelsFile models and file accessing models
File models and file accessing models
 
Server interview[1]
Server interview[1]Server interview[1]
Server interview[1]
 

Similar to 10.file system interface

638241896796578949.PPTcfrdrservbvmnbmnbjh
638241896796578949.PPTcfrdrservbvmnbmnbjh638241896796578949.PPTcfrdrservbvmnbmnbjh
638241896796578949.PPTcfrdrservbvmnbmnbjhprincekushwahfzd
 
ch11.ppt
ch11.pptch11.ppt
ch11.pptnikky58
 
ch12-File-System Implementation (1).pptx
ch12-File-System Implementation (1).pptxch12-File-System Implementation (1).pptx
ch12-File-System Implementation (1).pptxTulasi72
 
Chapter 13 silbershatz operating systems
Chapter 13 silbershatz operating systemsChapter 13 silbershatz operating systems
Chapter 13 silbershatz operating systemsGiulianoRanauro
 
Chapter 10 - File System Interface
Chapter 10 - File System InterfaceChapter 10 - File System Interface
Chapter 10 - File System InterfaceWayne Jones Jnr
 
file-system interface.pptx
file-system interface.pptxfile-system interface.pptx
file-system interface.pptxArzu758108
 
Chapter 14 Computer Architecture
Chapter 14 Computer ArchitectureChapter 14 Computer Architecture
Chapter 14 Computer ArchitectureGiulianoRanauro
 
file management_osnotes.ppt
file management_osnotes.pptfile management_osnotes.ppt
file management_osnotes.pptHelalMirzad
 
11.file system implementation
11.file system implementation11.file system implementation
11.file system implementationSenthil Kanth
 
Ch11 OS
Ch11 OSCh11 OS
Ch11 OSC.U
 
Ch11: File System Interface
Ch11: File System InterfaceCh11: File System Interface
Ch11: File System InterfaceAhmar Hashmi
 
File system interfacefinal
File system interfacefinalFile system interfacefinal
File system interfacefinalmarangburu42
 

Similar to 10.file system interface (20)

Ch11 file system interface
Ch11 file system interfaceCh11 file system interface
Ch11 file system interface
 
ch10.ppt
ch10.pptch10.ppt
ch10.ppt
 
FIle Management.ppt
FIle Management.pptFIle Management.ppt
FIle Management.ppt
 
638241896796578949.PPTcfrdrservbvmnbmnbjh
638241896796578949.PPTcfrdrservbvmnbmnbjh638241896796578949.PPTcfrdrservbvmnbmnbjh
638241896796578949.PPTcfrdrservbvmnbmnbjh
 
ch11.ppt
ch11.pptch11.ppt
ch11.ppt
 
ch12-File-System Implementation (1).pptx
ch12-File-System Implementation (1).pptxch12-File-System Implementation (1).pptx
ch12-File-System Implementation (1).pptx
 
ch11.ppt
ch11.pptch11.ppt
ch11.ppt
 
Chapter 13 silbershatz operating systems
Chapter 13 silbershatz operating systemsChapter 13 silbershatz operating systems
Chapter 13 silbershatz operating systems
 
Chapter 10 - File System Interface
Chapter 10 - File System InterfaceChapter 10 - File System Interface
Chapter 10 - File System Interface
 
file-system interface.pptx
file-system interface.pptxfile-system interface.pptx
file-system interface.pptx
 
Chapter 14 Computer Architecture
Chapter 14 Computer ArchitectureChapter 14 Computer Architecture
Chapter 14 Computer Architecture
 
file management_osnotes.ppt
file management_osnotes.pptfile management_osnotes.ppt
file management_osnotes.ppt
 
CH11.pdf
CH11.pdfCH11.pdf
CH11.pdf
 
11.file system implementation
11.file system implementation11.file system implementation
11.file system implementation
 
Ch11 OS
Ch11 OSCh11 OS
Ch11 OS
 
OSCh11
OSCh11OSCh11
OSCh11
 
OS_Ch11
OS_Ch11OS_Ch11
OS_Ch11
 
DFSNov1.pptx
DFSNov1.pptxDFSNov1.pptx
DFSNov1.pptx
 
Ch11: File System Interface
Ch11: File System InterfaceCh11: File System Interface
Ch11: File System Interface
 
File system interfacefinal
File system interfacefinalFile system interfacefinal
File system interfacefinal
 

More from Senthil Kanth

Wireless Communication and Networking by WilliamStallings Chap2
Wireless Communication and Networking  by WilliamStallings Chap2Wireless Communication and Networking  by WilliamStallings Chap2
Wireless Communication and Networking by WilliamStallings Chap2Senthil Kanth
 
wireless communication and networking Chapter 1
wireless communication and networking Chapter 1wireless communication and networking Chapter 1
wireless communication and networking Chapter 1Senthil Kanth
 
WML Script by Shanti katta
WML Script by Shanti kattaWML Script by Shanti katta
WML Script by Shanti kattaSenthil Kanth
 
WAP- Wireless Application Protocol
WAP- Wireless Application ProtocolWAP- Wireless Application Protocol
WAP- Wireless Application ProtocolSenthil Kanth
 
Introduction to Mobile Application Development
Introduction to Mobile Application DevelopmentIntroduction to Mobile Application Development
Introduction to Mobile Application DevelopmentSenthil Kanth
 
MOBILE APPs DEVELOPMENT PLATFORMS
MOBILE APPs DEVELOPMENT PLATFORMSMOBILE APPs DEVELOPMENT PLATFORMS
MOBILE APPs DEVELOPMENT PLATFORMSSenthil Kanth
 
Introduction to wireless application protocol (wap)ogi
Introduction to wireless application protocol (wap)ogiIntroduction to wireless application protocol (wap)ogi
Introduction to wireless application protocol (wap)ogiSenthil Kanth
 
XML Programming WML by Dickson K.W. Chiu PhD, SMIEEE
XML Programming WML by Dickson K.W. Chiu PhD, SMIEEEXML Programming WML by Dickson K.W. Chiu PhD, SMIEEE
XML Programming WML by Dickson K.W. Chiu PhD, SMIEEESenthil Kanth
 
Wireless Application Protocol WAP by Alvinen
Wireless Application Protocol WAP by AlvinenWireless Application Protocol WAP by Alvinen
Wireless Application Protocol WAP by AlvinenSenthil Kanth
 
HR QUESTIONS, INTERVIEW QUESTIONS
HR QUESTIONS, INTERVIEW QUESTIONSHR QUESTIONS, INTERVIEW QUESTIONS
HR QUESTIONS, INTERVIEW QUESTIONSSenthil Kanth
 
STOCK APPLICATION USING CORBA
STOCK APPLICATION USING CORBASTOCK APPLICATION USING CORBA
STOCK APPLICATION USING CORBASenthil Kanth
 
Zone Routing Protocol (ZRP)
Zone Routing Protocol (ZRP)Zone Routing Protocol (ZRP)
Zone Routing Protocol (ZRP)Senthil Kanth
 
On-Demand Multicast Routing Protocol
On-Demand Multicast Routing ProtocolOn-Demand Multicast Routing Protocol
On-Demand Multicast Routing ProtocolSenthil Kanth
 
Adhoc routing protocols
Adhoc routing protocolsAdhoc routing protocols
Adhoc routing protocolsSenthil Kanth
 
16.Distributed System Structure
16.Distributed System Structure16.Distributed System Structure
16.Distributed System StructureSenthil Kanth
 

More from Senthil Kanth (20)

Wireless Communication and Networking by WilliamStallings Chap2
Wireless Communication and Networking  by WilliamStallings Chap2Wireless Communication and Networking  by WilliamStallings Chap2
Wireless Communication and Networking by WilliamStallings Chap2
 
wireless communication and networking Chapter 1
wireless communication and networking Chapter 1wireless communication and networking Chapter 1
wireless communication and networking Chapter 1
 
WML Script by Shanti katta
WML Script by Shanti kattaWML Script by Shanti katta
WML Script by Shanti katta
 
WAP- Wireless Application Protocol
WAP- Wireless Application ProtocolWAP- Wireless Application Protocol
WAP- Wireless Application Protocol
 
What is WAP?
What is WAP?What is WAP?
What is WAP?
 
Introduction to Mobile Application Development
Introduction to Mobile Application DevelopmentIntroduction to Mobile Application Development
Introduction to Mobile Application Development
 
Markup Languages
Markup Languages Markup Languages
Markup Languages
 
MOBILE APPs DEVELOPMENT PLATFORMS
MOBILE APPs DEVELOPMENT PLATFORMSMOBILE APPs DEVELOPMENT PLATFORMS
MOBILE APPs DEVELOPMENT PLATFORMS
 
Introduction to wireless application protocol (wap)ogi
Introduction to wireless application protocol (wap)ogiIntroduction to wireless application protocol (wap)ogi
Introduction to wireless application protocol (wap)ogi
 
XML Programming WML by Dickson K.W. Chiu PhD, SMIEEE
XML Programming WML by Dickson K.W. Chiu PhD, SMIEEEXML Programming WML by Dickson K.W. Chiu PhD, SMIEEE
XML Programming WML by Dickson K.W. Chiu PhD, SMIEEE
 
Wireless Application Protocol WAP by Alvinen
Wireless Application Protocol WAP by AlvinenWireless Application Protocol WAP by Alvinen
Wireless Application Protocol WAP by Alvinen
 
HR QUESTIONS, INTERVIEW QUESTIONS
HR QUESTIONS, INTERVIEW QUESTIONSHR QUESTIONS, INTERVIEW QUESTIONS
HR QUESTIONS, INTERVIEW QUESTIONS
 
HR QUESTIONS
HR QUESTIONSHR QUESTIONS
HR QUESTIONS
 
STOCK APPLICATION USING CORBA
STOCK APPLICATION USING CORBASTOCK APPLICATION USING CORBA
STOCK APPLICATION USING CORBA
 
RSA alogrithm
RSA alogrithmRSA alogrithm
RSA alogrithm
 
Zone Routing Protocol (ZRP)
Zone Routing Protocol (ZRP)Zone Routing Protocol (ZRP)
Zone Routing Protocol (ZRP)
 
On-Demand Multicast Routing Protocol
On-Demand Multicast Routing ProtocolOn-Demand Multicast Routing Protocol
On-Demand Multicast Routing Protocol
 
Adhoc routing protocols
Adhoc routing protocolsAdhoc routing protocols
Adhoc routing protocols
 
DSDV VS AODV
DSDV VS AODV DSDV VS AODV
DSDV VS AODV
 
16.Distributed System Structure
16.Distributed System Structure16.Distributed System Structure
16.Distributed System Structure
 

Recently uploaded

Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...RKavithamani
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 

Recently uploaded (20)

TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 

10.file system interface

  • 1. Chapter 10: File-System InterfaceChapter 10: File-System Interface
  • 2. 10.2 Silberschatz, Galvin and GagneOperating System Concepts Chapter 10: File-System InterfaceChapter 10: File-System Interface File Concept Access Methods Directory Structure File-System Mounting File Sharing Protection
  • 3. 10.3 Silberschatz, Galvin and GagneOperating System Concepts ObjectivesObjectives To explain the function of file systems To describe the interfaces to file systems To discuss file-system design tradeoffs, including access methods, file sharing, file locking, and directory structures To explore file-system protection
  • 4. 10.4 Silberschatz, Galvin and GagneOperating System Concepts File ConceptFile Concept Contiguous logical address space Types: Data  numeric  character  binary Program
  • 5. 10.5 Silberschatz, Galvin and GagneOperating System Concepts File StructureFile Structure None - sequence of words, bytes Simple record structure Lines Fixed length Variable length Complex Structures Formatted document Relocatable load file Can simulate last two with first method by inserting appropriate control characters Who decides: Operating system Program
  • 6. 10.6 Silberschatz, Galvin and GagneOperating System Concepts File AttributesFile Attributes Name – only information kept in human-readable form Identifier – unique tag (number) identifies file within file system Type – needed for systems that support different types Location – pointer to file location on device Size – current file size Protection – controls who can do reading, writing, executing Time, date, and user identification – data for protection, security, and usage monitoring Information about files are kept in the directory structure, which is maintained on the disk
  • 7. 10.7 Silberschatz, Galvin and GagneOperating System Concepts File OperationsFile Operations File is an abstract data type Create Write Read Reposition within file Delete Truncate Open(Fi) – search the directory structure on disk for entry Fi, and move the content of entry to memory Close (Fi) – move the content of entry Fi in memory to directory structure on disk
  • 8. 10.8 Silberschatz, Galvin and GagneOperating System Concepts Open FilesOpen Files Several pieces of data are needed to manage open files: File pointer: pointer to last read/write location, per process that has the file open File-open count: counter of number of times a file is open – to allow removal of data from open-file table when last processes closes it Disk location of the file: cache of data access information Access rights: per-process access mode information
  • 9. 10.9 Silberschatz, Galvin and GagneOperating System Concepts Open File LockingOpen File Locking 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
  • 10. 10.10 Silberschatz, Galvin and GagneOperating System Concepts File Locking Example – Java APIFile Locking Example – Java API import java.io.*; import java.nio.channels.*; public class LockingExample { public static final boolean EXCLUSIVE = false; public static final boolean SHARED = true; public static void main(String arsg[]) throws IOException { FileLock sharedLock = null; FileLock exclusiveLock = null; try { RandomAccessFile raf = new RandomAccessFile("file.txt", "rw"); // get the channel for the file FileChannel ch = raf.getChannel(); // this locks the first half of the file - exclusive exclusiveLock = ch.lock(0, raf.length()/2, EXCLUSIVE); /** Now modify the data . . . */ // release the lock exclusiveLock.release();
  • 11. 10.11 Silberschatz, Galvin and GagneOperating System Concepts File Locking Example – Java APIFile Locking Example – Java API (cont)(cont) // this locks the second half of the file - shared sharedLock = ch.lock(raf.length()/2+1, raf.length(), SHARED); /** Now read the data . . . */ // release the lock exclusiveLock.release(); } catch (java.io.IOException ioe) { System.err.println(ioe); }finally { if (exclusiveLock != null) exclusiveLock.release(); if (sharedLock != null) sharedLock.release(); } } }
  • 12. 10.12 Silberschatz, Galvin and GagneOperating System Concepts File Types – Name, ExtensionFile Types – Name, Extension
  • 13. 10.13 Silberschatz, Galvin and GagneOperating System Concepts Access MethodsAccess Methods 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
  • 14. 10.14 Silberschatz, Galvin and GagneOperating System Concepts Sequential-access FileSequential-access File
  • 15. 10.15 Silberschatz, Galvin and GagneOperating System Concepts Simulation of Sequential Access on a Direct-accessSimulation of Sequential Access on a Direct-access FileFile
  • 16. 10.16 Silberschatz, Galvin and GagneOperating System Concepts Example of Index and Relative FilesExample of Index and Relative Files
  • 17. 10.17 Silberschatz, Galvin and GagneOperating System Concepts Directory StructureDirectory Structure A collection of nodes containing information about all files 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
  • 18. 10.18 Silberschatz, Galvin and GagneOperating System Concepts A Typical File-system OrganizationA Typical File-system Organization
  • 19. 10.19 Silberschatz, Galvin and GagneOperating System Concepts Operations Performed on DirectoryOperations Performed on Directory Search for a file Create a file Delete a file List a directory Rename a file Traverse the file system
  • 20. 10.20 Silberschatz, Galvin and GagneOperating System Concepts Organize the Directory (Logically) toOrganize the Directory (Logically) to ObtainObtain Efficiency – locating a file quickly 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 properties, (e.g., all Java programs, all games, …)
  • 21. 10.21 Silberschatz, Galvin and GagneOperating System Concepts Single-Level DirectorySingle-Level Directory A single directory for all users Naming problem Grouping problem
  • 22. 10.22 Silberschatz, Galvin and GagneOperating System Concepts Two-Level DirectoryTwo-Level Directory Separate directory for each user Path name Can have the same file name for different user Efficient searching No grouping capability
  • 23. 10.23 Silberschatz, Galvin and GagneOperating System Concepts Tree-Structured DirectoriesTree-Structured Directories
  • 24. 10.24 Silberschatz, Galvin and GagneOperating System Concepts Tree-Structured Directories (Cont)Tree-Structured Directories (Cont) Efficient searching Grouping Capability Current directory (working directory) cd /spell/mail/prog type list
  • 25. 10.25 Silberschatz, Galvin and GagneOperating System Concepts Tree-Structured Directories (Cont)Tree-Structured Directories (Cont) Absolute or relative path name Creating a new file is done in current directory Delete a file rm <file-name> Creating a new subdirectory is done in current directory mkdir <dir-name> Example: if in current directory /mail mkdir count mail prog copy prt exp count Deleting “mail” ⇒ deleting the entire subtree rooted by “mail”
  • 26. 10.26 Silberschatz, Galvin and GagneOperating System Concepts Acyclic-Graph DirectoriesAcyclic-Graph Directories Have shared subdirectories and files
  • 27. 10.27 Silberschatz, Galvin and GagneOperating System Concepts Acyclic-Graph Directories (Cont.)Acyclic-Graph Directories (Cont.) Two different names (aliasing) If dict deletes list ⇒ dangling pointer Solutions: Backpointers, so we can delete all pointers Variable size records a problem Backpointers using a daisy chain organization Entry-hold-count solution New directory entry type Link – another name (pointer) to an existing file Resolve the link – follow pointer to locate the file
  • 28. 10.28 Silberschatz, Galvin and GagneOperating System Concepts General Graph DirectoryGeneral Graph Directory
  • 29. 10.29 Silberschatz, Galvin and GagneOperating System Concepts General Graph Directory (Cont.)General Graph Directory (Cont.) 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
  • 30. 10.30 Silberschatz, Galvin and GagneOperating System Concepts File System MountingFile System Mounting A file system must be mounted before it can be accessed A unmounted file system (i.e. Fig. 11-11(b)) is mounted at a mount point
  • 31. 10.31 Silberschatz, Galvin and GagneOperating System Concepts (a) Existing. (b) Unmounted(a) Existing. (b) Unmounted PartitionPartition
  • 32. 10.32 Silberschatz, Galvin and GagneOperating System Concepts Mount PointMount Point
  • 33. 10.33 Silberschatz, Galvin and GagneOperating System Concepts File SharingFile Sharing Sharing of files on multi-user systems is desirable Sharing may be done through a protection scheme On distributed systems, files may be shared across a network Network File System (NFS) is a common distributed file-sharing method
  • 34. 10.34 Silberschatz, Galvin and GagneOperating System Concepts File Sharing – Multiple UsersFile Sharing – Multiple Users User IDs identify users, allowing permissions and protections to be per-user Group IDs allow users to be in groups, permitting group access rights
  • 35. 10.35 Silberschatz, Galvin and GagneOperating System Concepts File Sharing – Remote File SystemsFile Sharing – Remote File Systems Uses networking to allow file system access between systems Manually via programs like FTP Automatically, seamlessly using distributed file systems Semi automatically via the world wide web Client-server model allows clients to mount remote file systems from servers Server can serve multiple clients Client and user-on-client identification is insecure or complicated NFS is standard UNIX client-server file sharing protocol CIFS is standard Windows protocol Standard operating system file calls are translated into remote calls Distributed Information Systems (distributed naming services) such as LDAP, DNS, NIS, Active Directory implement unified access to information needed for remote computing
  • 36. 10.36 Silberschatz, Galvin and GagneOperating System Concepts File Sharing – Failure ModesFile Sharing – Failure Modes Remote file systems add new failure modes, due to network failure, server failure Recovery from failure can involve state information about status of each remote request Stateless protocols such as NFS include all information in each request, allowing easy recovery but less security
  • 37. 10.37 Silberschatz, Galvin and GagneOperating System Concepts File Sharing – ConsistencyFile Sharing – Consistency SemanticsSemantics Consistency semantics specify how multiple users are to access a shared file simultaneously Similar to Ch 7 process synchronization algorithms  Tend to be less complex due to disk I/O and network latency (for remote file systems Andrew File System (AFS) implemented complex remote file sharing semantics Unix file system (UFS) implements:  Writes to an open file visible immediately to other users of the same open file  Sharing file pointer to allow multiple users to read and write concurrently AFS has session semantics  Writes only visible to sessions starting after the file is closed
  • 38. 10.38 Silberschatz, Galvin and GagneOperating System Concepts ProtectionProtection File owner/creator should be able to control: what can be done by whom Types of access Read Write Execute Append Delete List
  • 39. 10.39 Silberschatz, Galvin and GagneOperating System Concepts Access Lists and GroupsAccess Lists and Groups Mode of access: read, write, execute Three classes of users RWX a) owner access 7 ⇒ 1 1 1 RWX b) group access 6 ⇒ 1 1 0 RWX c) public access 1 ⇒ 0 0 1 Ask manager to create a group (unique name), say G, and add some users to the group. For a particular file (say game) or subdirectory, define an appropriate access. owner group public chmod 761 game Attach a group to a file chgrp G game
  • 40. 10.40 Silberschatz, Galvin and GagneOperating System Concepts Windows XP Access-control List ManagementManagement
  • 41. 10.41 Silberschatz, Galvin and GagneOperating System Concepts A Sample UNIX Directory ListingA Sample UNIX Directory Listing
  • 42. End of Chapter 10End of Chapter 10