18
Matakuliah : sistem Operasi 1

Matakuliah: sistem Operasi 1. Learning Outcomes Pada akhir pertemuan ini, diharapkan mahasiswa akan mampu : menjelaskan konsep sistem file (C2) 2

Embed Size (px)

Citation preview

Matakuliah : sistem Operasi

1

Learning Outcomes

Pada akhir pertemuan ini, diharapkan mahasiswa

akan mampu :menjelaskan konsep sistem file (C2)

2

Outline MateriPenamaan fileStruktur fileTipe FilePengaksesan fileOperasi fileDirektori

3

Long-term Information Storage

1. Must store large amounts of data

2. Information stored must survive the termination of the process using it

3. Multiple processes must be able to access the information concurrently

4

File Naming

Typical file extensions

5

File Structure

Three kinds of filesbyte sequencerecord sequencetree

6

File Types

Regular file ASCII/binaryDirectories

7

8

File Types (binary files)

(a) An executable file (b) An archive

Header

Text

Data

Relocation bits

Symbol table

Collection of library procedures (modules) compiled but not linked

File AccessSequential accessread all bytes/records from the beginningcannot jump around, could rewind or back upconvenient when medium was mag tape

Random accessbytes/records read in any orderessential for data base systemsread can be …

move file marker (seek), then read or … read and then move file marker

9

File Attributes

Possible file attributes10

File Operations1. Create2. Delete3. Open4. Close5. Read6. Write

7. Append8. Seek9. Get

attributes10.Set

Attributes11.Rename

11

An Example Program Using File System Calls (1/2)

12

Eg. copyfile abc xyz

An Example Program Using File System Calls (2/2)

13

DirectoriesSingle-Level Directory Systems

A single level directory systemcontains 4 filesowned by 3 different people, A, B, and C

14

Two-level Directory Systems

Letters indicate owners of the directories and files

15

Hierarchical Directory Systems

A hierarchical directory system

16

Path Names

A UNIX directory tree

17

•Absolute vs relative path name

Directory Operations1. Create2. Delete3. Opendir4. Closedir

5. Readdir6. Rename7. Link8. Unlink

18