0% found this document useful (0 votes)
37 views

File System Operations Group 8-BSSE

This document discusses file system operations and concepts. It is authored by WASSANYI KEVIN STEPHEN, NAKIMBUGWE RUTH LUCKY, SUUBI TREVOR, and MULUNGI STEVEN JUNIOR. The document defines file system operations like create, open, close, write, read, truncate, and delete. It also discusses concepts like file control blocks, open file tables, file locking, and how file pointers and buffers are used.

Uploaded by

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

File System Operations Group 8-BSSE

This document discusses file system operations and concepts. It is authored by WASSANYI KEVIN STEPHEN, NAKIMBUGWE RUTH LUCKY, SUUBI TREVOR, and MULUNGI STEVEN JUNIOR. The document defines file system operations like create, open, close, write, read, truncate, and delete. It also discusses concepts like file control blocks, open file tables, file locking, and how file pointers and buffers are used.

Uploaded by

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

FILE SYSTEM OPERATIONS

Group G-8
Group members
WASSANYI KEVIN STEPHEN – 20/U/7808/PS

NAKIMBUGWE RUTH LUCKY – 20/U/7830/PS

SUUBI TREVOR - 20/U/2045/EVE

MULUNGI STEVEN JUNIOR- 20/U/23507/PS

NABWIRE ESTHER – 20/U/2014/EVE


 A file System defines how files are named,
stored and retrieved from a storage device.

 It is responsible for space management,


metadata, data encryption, file access control
File System and data integrity.
 File System operations assist in the execution
of naming, storing and retrieving files from
storage devices.
 Create() – creates a file in the system
 open() - searches the directory, copying the
directory entry into the open-file table.
Examples of  Close() - Closes or exits a file
File System  Write() - writes information into the file
Operations  Read() - reads the contents from a file
 Truncate() – Deletes the file except the
attributes.
 Delete() – Deletes the file plus its attributes.
The system-wide open-fil table contains a copy of the
FCB of each open file, as well as other information.
The per-process open-fil table contains pointers to
Points to Note the appropriate entries in the system-wide open-file
table, as well as other information, for all files the
process has open.
Buffers hold file-system blocks when they are being
read from or written to a file system.
FCB

File permissions

FCB File dates(create, access, write)

File Control File owner, group

block File size

File data blocks or pointers to file


data blocks
Creating a file
To create a new file, a process calls the logical
file system. The logical file system knows the
format of the directory structures. It allocates a
new FCB . The system then reads the
appropriate directory into memory, updates it
Examples of with the new file name and FCB, and writes it
back to the file system.
file system
Writing to a file
operations
 Make a system call specifying both the name of
the file and the information to be written to the
file.
 The system must keep a write pointer to the
location in the file where the next write is to
take place.
Reading a file
 Use a system call that specifies the name of the
file and where in memory the next block of the
file should be put.
 Once the read has taken place, the read pointer
Conti.. is updated.

Repositioning within a file


 The directory is searched for the appropriate
entry and the current file position is set to a
given value
Deleting a file
 Search the directory for a named file and
release all file space and erase the directory
entry.
Conti..
Truncating a file
 The contents of a file are erased but its
attributes stay.
 The Open-file Table stores the information
about all the files that are open while the OS is
running.
 The operating system typically uses uses two
levels of internal tables;
Open-file  A per-process table – tracks all files that a
Table process has open
 A system-wide table – Contains process-
independent information such as the location
of file on disk, access dates and file size.
 File pointer – allows the system to track of the
next read-write location.
 File open count – A counter that tracks the
Information number of opens and closes, and reaches zero
associated on the last close.
with an open  Disk location of the file – location info is kept
file in memory to avoid having to read it from the
disk for each operation.
 Access rights – each process opens a file in an
access mode.
 This is a mechanism that restricts access to a computer
file, by allowing only one user or process to modify or
delete it at a specific time and prevent reading of the file
it is being modified or deleted.
• Provided by some OS and file systems
 Mediates access to files
Open file  Mandatory or advisory locking
locking  Mandatory –some measures are required to ensure that
processes do not become involved in a deadlock while
trying to acquire file locks.
• access is denied depending on locks held and requested
 Advisory –allows processes to find status of locks and
decide what to do.
 To avoid this constant searching of the file
directory involved with most operations, many
systems require that an open system call be
used before that file is first used.
 When a file operation is requested, the file is
Points to note specified via an index into the open-file table so
no searching is required.
 When the file is no longer actively used, it is
closed by the process and the OS removes its
entry in the open-file table.
 Some systems implicitly open a file when the
first reference is made to it and close it
automatically when the program ends.
Points to note  Most systems require that the programmer
open a file explicitly with the open system call
before that file can be used.

You might also like