Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

File Management in Operating Systems: An Overview, Slides of Operating Systems

Database SystemsOperating SystemsData Structures and Algorithms

A part of a lecture series on Operating Systems at the University of Bedfordshire. It focuses on file management, covering topics such as interaction with the file manager, files, physical storage allocation, directories, file system, access, and data compression.

What you will learn

  • How does access control work in Operating Systems?
  • What are the advantages of data compression?
  • What are the different types of file storage allocation?
  • How does the file system help in efficient file organization?
  • What is the role of the file manager in Operating Systems?

Typology: Slides

2021/2022

Uploaded on 09/27/2022

alenapool
alenapool 🇬🇧

4.6

(13)

223 documents

1 / 46

Toggle sidebar

Related documents


Partial preview of the text

Download File Management in Operating Systems: An Overview and more Slides Operating Systems in PDF only on Docsity! Operating Systems Lecture #5: File Management Written by David Goodwin based on the lecture series of Dr. Dayou Li and the book Understanding Operating Systems 4thed. by I.M.Flynn and A.McIver McHoes (2006) Department of Computer Science and Technology, University of Bedfordshire. Operating Systems, 2013 25th February 2013 46 Lecture #5 File Management David Goodwin University of Bedfordshire Introduction Interaction with the file manager Files Physical storage allocation Directories File system Access Data compression summary Operating Systems Outline 1 Introduction 2 Interaction with the file manager 3 Files 4 Physical storage allocation 5 Directories 6 File system 7 Access 8 Data compression 9 summary 46 Lecture #5 File Management David Goodwin University of Bedfordshire 5Introduction Interaction with the file manager Files Physical storage allocation Directories File system Access Data compression summary Operating Systems Definitions field is a group of related bytes that can be identified by the user with a name, type, and size. record is a group of related fields. file is a 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 file; unlike databases it has no dimensionality. database appear to be a type of file, but databases are more complex. They are groups of related files that are interconnected at various levels to give flexibility of access to the data stored. program files contain instructions. data files contain data. directories are listings of filenames and their attributes. 46 Lecture #5 File Management David Goodwin University of Bedfordshire Introduction 6Interaction with the file manager Files Physical storage allocation Directories File system Access Data compression summary Operating Systems Interaction with the file manager 46 Lecture #5 File Management David Goodwin University of Bedfordshire Introduction 7Interaction with the file manager Files Physical storage allocation Directories File system Access Data compression summary Operating Systems Interacting with the File Manager ˆ User communicates via commands, either embedded in user’s program or submitted interactively by user. ˆ embedded commands are: ˆ OPEN / CLOSE - pertain to the availability of a file for the program invoking it. ˆ READ / WRITE - are I/O commands. ˆ MODIFY - specialised WRITE command for existing data files, allows for appending records or for rewriting selected records in their origional place in the file. ˆ interactive commands are: ˆ CREATE / DELETE - deal with the system’s knowledge of the file (some systems have the first instance of SAVE command, others OPEN NEW, OPEN. . .FOR OUTPUT. ˆ RENAME - allows users to change the name of an existing file. ˆ COPY - lets users make duplicate copies of existing files. ˆ These commands (and many more) are designed to be simple to make them device independent. 46 Lecture #5 File Management David Goodwin University of Bedfordshire Introduction Interaction with the file manager 10Files Physical storage allocation Directories File system Access Data compression summary Operating Systems Files 46 Lecture #5 File Management David Goodwin University of Bedfordshire Introduction Interaction with the file manager 11Files Physical storage allocation Directories File system Access Data compression summary Operating Systems File attributes ˆ Information about files is kept in the directory structure, which is also maintained on the disk. ˆ Name – only information kept in human-readable form. ˆ Identifier – non-human readable unique tag (usually a number). ˆ 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. 46 Lecture #5 File Management David Goodwin University of Bedfordshire Introduction Interaction with the file manager 12Files Physical storage allocation Directories File system Access Data compression summary Operating Systems File operations ˆ Create ˆ Write ˆ Read ˆ Reposition within file – file seek ˆ 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. 46 Lecture #5 File Management David Goodwin University of Bedfordshire Introduction Interaction with the file manager 15Files Physical storage allocation Directories File system Access Data compression summary Operating Systems File types – name and extension 46 Lecture #5 File Management David Goodwin University of Bedfordshire Introduction Interaction with the file manager 16Files Physical storage allocation Directories File system Access Data compression summary Operating Systems Access methods ˆ Sequential access ˆ Easiest ˆ File searched from its beginning until record is found ˆ Direct (relative/random) access ˆ Only on direct access storage devices ˆ Records identified by their relative address to the beginning of the file ˆ Indexed access ˆ Combines the best of sequential and direct access 46 Lecture #5 File Management David Goodwin University of Bedfordshire Introduction Interaction with the file manager 17Files Physical storage allocation Directories File system Access Data compression summary Operating Systems Access methods - direct access example ˆ Records identified by logical address, them relative to the beginning of the file. ˆ User identifies a field in the record format and designates it as the key field because it uniquely identifies each record. ˆ the program used to store the data follows a set of instructions called a hashing algorithm, that transforms each key into a number, the record’s logical address. ˆ This is given to the File Manager, which takes the necessary steps to translate the logical address into a physical address (cylinder, surface, and record numbers), preserving the file organisation. 46 Lecture #5 File Management David Goodwin University of Bedfordshire Introduction Interaction with the file manager Files 20Physical storage allocation Directories File system Access Data compression summary Operating Systems Physical storage allocation ˆ Noncontigious storage ˆ files use any space available on disk ˆ records stored in a contigious manner only if there’s enough empty space ˆ any remaining records, and all other additions to the file, are stored in other sections of the disk ˆ sometimes called extents of the file - linked together with pointers in one of two ways ˆ at storage level - each extent points to the next one in sequence ˆ at directory level - each extent is listed with its physical address, size, and a pointer to the next extent. A null pointer indicates it’s the last one. ˆ doesnt support direct access 46 Lecture #5 File Management David Goodwin University of Bedfordshire Introduction Interaction with the file manager Files 21Physical storage allocation Directories File system Access Data compression summary Operating Systems Physical storage allocation ˆ Indexed storage ˆ brings together into an index block, the pointers linking every extent of that file ˆ every file has its own index block ˆ deosn’t improve storage ˆ supports direct access 46 Lecture #5 File Management David Goodwin University of Bedfordshire Introduction Interaction with the file manager Files Physical storage allocation 22Directories File system Access Data compression summary Operating Systems Directories 46 Lecture #5 File Management David Goodwin University of Bedfordshire Introduction Interaction with the file manager Files Physical storage allocation 25Directories File system Access Data compression summary Operating Systems Information on a device directory ˆ Name ˆ Type ˆ Address ˆ Current length ˆ Maximum length ˆ Date last accessed (for archival) ˆ Date last updated (for dump) ˆ Owner ID (who pays) ˆ Protection information 46 Lecture #5 File Management David Goodwin University of Bedfordshire Introduction Interaction with the file manager Files Physical storage allocation 26Directories File system Access Data compression summary Operating Systems Operations performed on a directory ˆ Search for a file ˆ Create a file ˆ Delete a file ˆ List a directory ˆ Rename a file ˆ Traverse the file system 46 Lecture #5 File Management David Goodwin University of Bedfordshire Introduction Interaction with the file manager Files Physical storage allocation 27Directories File system Access Data compression summary Operating Systems Effective organisation of a directory ˆ Efficiency – locating a file quickly ˆ Naming – convenient to users ˆ Different users can have the 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, . . . ) 46 Lecture #5 File Management David Goodwin University of Bedfordshire Introduction Interaction with the file manager Files Physical storage allocation 30Directories File system Access Data compression summary Operating Systems Tree-structured directories ˆ Efficient searching ˆ Grouping capability ˆ Current directory (working directory) cd /spell/mail/prog type list ˆ Absolute path name begins at the root ˆ Relative path name defines a path from current directory ˆ Creating a new file done in current directory ˆ Delete a file rm <file-name> ˆ Creating a new subdirectory is done in current directory mkdir <dir-name> 46 Lecture #5 File Management David Goodwin University of Bedfordshire Introduction Interaction with the file manager Files Physical storage allocation 31Directories File system Access Data compression summary Operating Systems Acyclic graph directories 46 Lecture #5 File Management David Goodwin University of Bedfordshire Introduction Interaction with the file manager Files Physical storage allocation 32Directories File system Access Data compression summary Operating Systems Acyclic graph directories ˆ There are shared subdirectories and files. ˆ Different absolute path names (aliasing). ˆ If words deletes list → dangling pointer. Solutions: ˆ Backpointers, so we can delete all pointers. ˆ Backpointers using a daisy chain organisation. ˆ Entry-hold-count solution. 46 Lecture #5 File Management David Goodwin University of Bedfordshire Introduction Interaction with the file manager Files Physical storage allocation Directories 35File system Access Data compression summary Operating Systems File system 46 Lecture #5 File Management David Goodwin University of Bedfordshire Introduction Interaction with the file manager Files Physical storage allocation Directories 36File system Access Data compression summary Operating Systems File system mounting ˆ A file system must be mounted before it can be accessed. ˆ An unmounted file system (device) is mounted at a mount point. ˆ Typical example - UNIX systems e.g. user’s directories can be mounted as /home or /users and thus a user’s directory may become /home/user01 or /users/user01 where /home or /users is the mount point 46 Lecture #5 File Management David Goodwin University of Bedfordshire Introduction Interaction with the file manager Files Physical storage allocation Directories 37File system Access Data compression summary Operating Systems File system mounting ˆ a) Existing ˆ b) Unmounted partition ˆ c) Mounted at users/ 46 Lecture #5 File Management David Goodwin University of Bedfordshire Introduction Interaction with the file manager Files Physical storage allocation Directories File system 40Access Data compression summary Operating Systems Access 46 Lecture #5 File Management David Goodwin University of Bedfordshire Introduction Interaction with the file manager Files Physical storage allocation Directories File system 41Access Data compression summary Operating Systems Access lists and groups ˆ Mode of access: read, write, execute ˆ Three classes of users 1 a) owner access 7 → 1 1 1 (RWX) 2 b) group access 6 → 1 1 0 (RWX) 3 c) public access 1 → 0 0 1 (RWX) ˆ 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. 46 Lecture #5 File Management David Goodwin University of Bedfordshire Introduction Interaction with the file manager Files Physical storage allocation Directories File system Access 42Data compression summary Operating Systems Data compression 46 Lecture #5 File Management David Goodwin University of Bedfordshire Introduction Interaction with the file manager Files Physical storage allocation Directories File system Access Data compression 45summary Operating Systems Key Terms absolute filename contigious storage current directory data compression data file database device independent direct record organisation directory extension field file 46 Lecture #5 File Management David Goodwin University of Bedfordshire Introduction Interaction with the file manager Files Physical storage allocation Directories File system Access Data compression 46summary Operating Systems Key Terms file descriptor hashing algorithm indexed sequential record organisation key field logical address master file directory noncontigious storage program file record relative address relative filename sequential record organisation volume
Docsity logo



Copyright © 2024 Ladybird Srl - Via Leonardo da Vinci 16, 10126, Torino, Italy - VAT 10816460017 - All rights reserved