Chico CSCI 640 - Chapter 10.2: File-­System Interface

Unformatted text preview:

Chapter 10.2: File-System InterfaceChapter 10: File-System InterfaceDirectory StructureDirectoriesDirectories - 2Slide 6Operations Performed on DirectorySingle-Level DirectoryTwo-Level DirectorySlide 10Tree-Structured DirectoriesTree-Structured Directories - 2Tree-Structured Directories – Path NamesSlide 14Tree-Structured Directories (Cont)Tree-Structured Directories (cont)Acyclic-Graph DirectoriesAcyclic-Graph Directories (Cont.)LinksMore on Links – in UnixGeneral Graph DirectoryGeneral Graph Directory (Cont.)General Graph Directory – Garbage CollectionAcyclic Graph – Garbage CollectionEnd of Chapter 10.2Chapter 10.2: File-System InterfaceChapter 10.2: File-System Interface10.2Silberschatz, Galvin and Gagne ©2005Operating System ConceptsChapter 10: File-System InterfaceChapter 10: File-System InterfaceChapter 10.1File ConceptAccess MethodsChapter 10.2Directory Structure - continuedFile-System MountingProtection10.3Silberschatz, Galvin and Gagne ©2005Operating System ConceptsDirectory StructureDirectory Structure10.4Silberschatz, Galvin and Gagne ©2005Operating System ConceptsDirectoriesDirectoriesSystems may have zero or more file systems and each of these may be of various types used to manage data.Files systems themselves may consist of millions of files scattered and organized (or not well organized) in a many of ways.All files must be managed and organized, as files constitute a major component of any computing system..For files that are organized (again, they don’t have to be…) the principal way of organizing files is by using a directory But there are many different directory structures used to organize / manage files.These various directories can contain different data items too.We will look at the key ways in which directories are organized.10.5Silberschatz, Galvin and Gagne ©2005Operating System ConceptsDirectories - 2Directories - 2While disks may certainly be dedicated, it is frequently the case that we may have multiple file systems on a single disk.These can be organized in many ways and termed also in many ways.Disks themselves may be partitioned, can have ‘raw disk,’ ‘regular’ formatted disk, etc. Disks can be sliced and diced by manufacturers and vendors many ways.For the time being, refer to a storage device holding a file system as a volume.A volume may be thought of as a virtual disk, because volumes can actually span physical devices.A disk itself can not only store data files, program files, directories (all with a variety of formats), and more but also a host of other storable items such as other operating systems.A Volume Table of Contents (VTOC), which is a device directory, contains information describing the volume contents. Simply refer to these structures as ‘directories.’10.6Silberschatz, Galvin and Gagne ©2005Operating System ConceptsDirectory StructureDirectory StructureA directory can be organized in various ways.A directory may be considered a table mapping file names to a specific files. A directory may be considered a collection of nodes containing information about all files; that is, the directory entry not only points to a file but also contains much informaton about the file.F 1F 2F 3F 4F nDirectoryFilesBoth the directory structure and the files reside on diskBackups of these two structures are often kept on magnetic tapes10.7Silberschatz, Galvin and Gagne ©2005Operating System ConceptsOperations Performed on DirectoryOperations Performed on DirectorySearch for a fileGiven a file name, we need to be able to search the directory to find the file.Create a file; Delete a file.Need to be able to create / delete file on disk and hence maintain an appropriate entry in the directoryList a directory We need to be able to list the contents of a directory and see characteristics of the files contained in the directory. Rename a fileOften need to rename a file; its name may imply its position in a directory. (a full path name…)Traverse the file systemHere we want to be able to access the directory and every file contained in the directory structure.We want to be able to do all this very quickly!10.8Silberschatz, Galvin and Gagne ©2005Operating System ConceptsSingle-Level DirectorySingle-Level DirectoryA single directory for all users – the simplest format. All files in the same directory.Problems:Files must have unique namesThis is very difficult (not practical) for multiple users using the same directory.Not uncommon for a single user to have hundreds of files on a single computing system.(I know that I do on my local Linux machine!)10.9Silberschatz, Galvin and Gagne ©2005Operating System ConceptsTwo-Level DirectoryTwo-Level DirectoryHere, we have a separate directory for each userSimilar structure. A master file directory contains the user name / account number and points to the file directory for that user.In creating a file, the OS uses the user’s user file directory (UFD) as part of the pathname and thus ensures file names and other entries are unique..Creation of a new directory will normally require a system administrator.Every entry has a path name to uniquely define / locate a file.. Other systems require a volume, as in C:\mydir\pgr1.java.10.10Silberschatz, Galvin and Gagne ©2005Operating System ConceptsTwo-Level DirectoryTwo-Level Directory Important to note that for system files, such as loaders, linkers, assemblers, compilers, and various other ‘commands,’ these too are defined as files and when we invoke them, the file is loaded and executed.e.g gcc pgm1.c This invokes the compiler and passes a file name as a parameter.But where is gcc?Search Path: So, many commonly used files, such as system files are put in a special directory for system files.Because the user’s directory is always searched first, a ‘not-found’ will result in a search of this system directory.The sequence of directories searched when a file is named is called a search path and this can have many fully-defined directories in it.Both Unix and Windows machines use this approach.10.11Silberschatz, Galvin and Gagne ©2005Operating System ConceptsTree-Structured DirectoriesTree-Structured DirectoriesSo we’ve seen a two-level directory.The natural extension to a two-level directory is a tree (inverted tree) of arbitrary height.A tree, by


View Full Document

Chico CSCI 640 - Chapter 10.2: File-­System Interface

Download Chapter 10.2: File-­System Interface
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Chapter 10.2: File-­System Interface and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Chapter 10.2: File-­System Interface 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?