0% found this document useful (0 votes)
2 views19 pages

OS@4

The document outlines the file-system interface, detailing file attributes, operations, and structures. It discusses directory organization, access methods, and file sharing, emphasizing the importance of protection and user permissions. Additionally, it describes different directory types and access control mechanisms in Unix/Linux systems.

Uploaded by

Divya G
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views19 pages

OS@4

The document outlines the file-system interface, detailing file attributes, operations, and structures. It discusses directory organization, access methods, and file sharing, emphasizing the importance of protection and user permissions. Additionally, it describes different directory types and access control mechanisms in Unix/Linux systems.

Uploaded by

Divya G
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 19

File-System Interface

&
operations
File 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
File Operations
● File is an abstract data type
● Create
● Write – at write pointer location
● Read – at read pointer location
● Reposition within 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
File Structure
● None - sequence of words, bytes
● Simple record structure
● Lines
● Fixed length
● Variable length
● Complex Structures
● Formatted document
● Relocatable load file
Sequential-access File
Other Access Methods

● Can be built on top of base methods


● General involve creation of an index for the file
● Keep index in memory for fast determination of location of
data to be operated on (consider UPC code plus record of
data about that item)
● If too large, index (in memory) of the index (on disk)
● IBM indexed sequential-access method (ISAM)
● Small master index, points to disk blocks of secondary
index
● File kept sorted on a defined key
● All done by the OS
● VMS operating system provides index and relative files as
another example (see next slide)
Example of Index and Relative Files
Directory Structure

● A collection of nodes containing information about all files

Directory

Files F F F
F 4
1 2
3 F
n

Both the directory structure and the files reside on disk


Disk Structure
● Disk can be subdivided into partitions
● Disk or partition can be used raw – without a file system, or
formatted with a file system
● Partitions also known as minidisks, slices
● Entity containing file system known as a volume
● Each volume containing file system also tracks that file
system’s info in device directory or volume table of contents
A Typical File-system Organization
Operations Performed on Directory
● Search for a file

● Create a file

● Delete a file

● List a directory

● Rename a file
Directory Organization

The directory is organized logically to obtain

● 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, …)
Single-Level Directory
● A single directory for all users

● Naming problem
● Grouping problem
Two-Level Directory
● Separate directory for each user

● Path name
● Can have the same file name for different user
● Efficient searching
● No grouping capability
Acyclic-Graph Directories
● Have shared subdirectories and files
File 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
● If multi-user system
● User IDs identify users, allowing permissions and
protections to be per-user
Group IDs allow users to be in groups, permitting group
access rights
● Owner of a file / directory
● Group of a file / directory
Protection
● File owner/creator should be able to control:
● what can be done
● by whom
● Types of access
● Read
● Write
● Execute
● Append
● Delete
● List
Access Lists and Groups
● Mode of access: read, write, execute
● Three classes of users on Unix / Linux
RWX
a) owner access 7 ⇒ 111
RWX
b) group access 6 ⇒ 110
RWX
c) public access 1 ⇒ 001
● 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.

Attach a group to a file


chgrp G game
A Sample UNIX Directory Listing

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy