computer studies (al) file management file system interface

14
Computer Studies (AL) File Management File system interface

Upload: muriel-manning

Post on 11-Jan-2016

219 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Computer Studies (AL) File Management File system interface

Computer Studies (AL)

File ManagementFile system interface

Page 2: Computer Studies (AL) File Management File system interface

Reference Silberschatz, Galvin, Gagne “Operating

System Concepts 6th edition”, 2003, Wiley

Page 3: Computer Studies (AL) File Management File system interface

Content File concept

Attribute, basic operation, type Access method

Sequential, direct Directory Structure

Single-level, two-level, tree structure Absolute path, relative path

File System Mounting File Sharing (optional) File protection

Page 4: Computer Studies (AL) File Management File system interface

File Concept A file is a named collection of related

information that is recorded on secondary storage.

Files are mapped, by OS, onto physical device.

Page 5: Computer Studies (AL) File Management File system interface

Three special type of files Source file is a sequence of subroutines and

functions, each of which is further organized as declarations followed by executable statements.

An object file is a sequence of bytes organized into blocks understandable by the system’s linker.

An executable file is a series of code sections that the loader can bring into memory and execute.

Page 6: Computer Studies (AL) File Management File system interface

File attributes Name Identifier Type Location Size Protection Time, date and user identification

Page 7: Computer Studies (AL) File Management File system interface

File Operations Create a file Writing a file Reading a file Repositioning within a file Deleting a file Truncating a file (erase content, keep its

attributes) Appending a file (add info. To a file.) Renaming a file

Page 8: Computer Studies (AL) File Management File system interface

Open-file table Most of the file operations involve searching the directory for the entry

associated with the named file. To avoid these searching, many systems require that an open system call

be used before that file is first used actively. The OS keeps a small table containing information about all open files. When a file operation is requested, the file is specified via an index into

this table, so no searching is required. When the file is no longer actively used, it is closed by the process and the operating system removes its entry in the open-file table. Information associated to open file includes: File pointer File open count (no. of process) Disk location of the file Access right

Page 9: Computer Studies (AL) File Management File system interface

File type The system uses the extension to indicate

the type of the file and the type of operations that can be done on that file Executable: exe, com, bin Word processor: doc, rtf Multimedia: mpeg, mov, rm

Page 10: Computer Studies (AL) File Management File system interface

File Access method Sequential access

Information in the file is processed in order, one record after the order

Usually base on a tape model of a file. Variable-length record.

Direct access Read and write records rapidly in no particular order Base on disc model Fixed-length record

Page 11: Computer Studies (AL) File Management File system interface

Directory structure The file system of computers can be

extensive 1. Disk is split into one or more partition 2. In each partition, there are number of

directories. Single-level directory: all files are contained in the

same directory. Two-level directory: user file directory for user

data, where master file directory contains system files.

Page 12: Computer Studies (AL) File Management File system interface

Path Absolute path begins at the root and

follows a path down to the specified file, giving the directory names on the path E.g. root/spell/mail/prt/first

Relative path defines a path from the current directory E.g. prt/first

Page 13: Computer Studies (AL) File Management File system interface

Protection Types of access (controlled access)

Read Write Execute Append Delete List

Page 14: Computer Studies (AL) File Management File system interface

Access control Files and directories are associated to an access-

control list (ACL) Three classifications of users in connection with

each file: Owner: the user who created the file is the owner Group: A set of users who are sharing the file and

need similar access is a group, or group Universe: all other users in the system constitute the

universe