file systems long-term information storage store large amounts of information information must...
TRANSCRIPT
![Page 1: File Systems Long-term Information Storage Store large amounts of information Information must survive the termination of the process using it Multiple](https://reader036.vdocument.in/reader036/viewer/2022070409/56649ea05503460f94ba35f1/html5/thumbnails/1.jpg)
File Systems Long-term Information Storage
Store large amounts of information Information must survive the termination of
the process using it Multiple processes must be able to access
the information concurrently. Files are the units on external media
that provide us with a solution to these three issues.
![Page 2: File Systems Long-term Information Storage Store large amounts of information Information must survive the termination of the process using it Multiple](https://reader036.vdocument.in/reader036/viewer/2022070409/56649ea05503460f94ba35f1/html5/thumbnails/2.jpg)
File System Part of the OS that manages these
aspects of files Structuring Naming Accessing Using Protecting Implemented
![Page 3: File Systems Long-term Information Storage Store large amounts of information Information must survive the termination of the process using it Multiple](https://reader036.vdocument.in/reader036/viewer/2022070409/56649ea05503460f94ba35f1/html5/thumbnails/3.jpg)
Files (User’s POV)
Files are given a name upon creation Naming convention differs by OS
DOS has a 8 character limitation for the name Windows XP supports 255 character file names Character set that is allowed for naming of files
also differs by OS Some OS have case sensitive file names
file, FILE, File, FiLe, filE are all different in UNIX but the same in MS-DOS
![Page 4: File Systems Long-term Information Storage Store large amounts of information Information must survive the termination of the process using it Multiple](https://reader036.vdocument.in/reader036/viewer/2022070409/56649ea05503460f94ba35f1/html5/thumbnails/4.jpg)
Files (User’s POV) cont. File Extensions
In addition to the name most OSs have a second part of the file name called the extension
Extension usually indicates the type of file
However, the extension may can be renamed and the program that uses that file could care less about the extension… it will still load/execute the file correctly
![Page 5: File Systems Long-term Information Storage Store large amounts of information Information must survive the termination of the process using it Multiple](https://reader036.vdocument.in/reader036/viewer/2022070409/56649ea05503460f94ba35f1/html5/thumbnails/5.jpg)
Common File Extensions and Meanings
![Page 6: File Systems Long-term Information Storage Store large amounts of information Information must survive the termination of the process using it Multiple](https://reader036.vdocument.in/reader036/viewer/2022070409/56649ea05503460f94ba35f1/html5/thumbnails/6.jpg)
File Structure
Unstructured Sequence of Bytes – Most Flexible Meaning must be imposed by the user UNIX and Windows uses this
Record Sequence – fixed length records each with some internal structure (antiquated system)
![Page 7: File Systems Long-term Information Storage Store large amounts of information Information must survive the termination of the process using it Multiple](https://reader036.vdocument.in/reader036/viewer/2022070409/56649ea05503460f94ba35f1/html5/thumbnails/7.jpg)
File Structure (cont.)
Tree of Records – Each record contains a key field in a particular position. The tree is sorted on the key field for rapid searching. Used in mainframes and commercial
data processing
![Page 8: File Systems Long-term Information Storage Store large amounts of information Information must survive the termination of the process using it Multiple](https://reader036.vdocument.in/reader036/viewer/2022070409/56649ea05503460f94ba35f1/html5/thumbnails/8.jpg)
File Types
Regular Files – contain user information
Directories – system files that maintain structure of the file system
Character Special – Used to model serial I/O devices
Block Special – model disks
![Page 9: File Systems Long-term Information Storage Store large amounts of information Information must survive the termination of the process using it Multiple](https://reader036.vdocument.in/reader036/viewer/2022070409/56649ea05503460f94ba35f1/html5/thumbnails/9.jpg)
Regular Files
Usually either ASCII or Binary ASCII – contains text (stuff we can
read) Binary – have an internal structure
known to the program that reads them (we cannot open these up and easily read them)
![Page 10: File Systems Long-term Information Storage Store large amounts of information Information must survive the termination of the process using it Multiple](https://reader036.vdocument.in/reader036/viewer/2022070409/56649ea05503460f94ba35f1/html5/thumbnails/10.jpg)
Binary (Executable and Archive)
![Page 11: File Systems Long-term Information Storage Store large amounts of information Information must survive the termination of the process using it Multiple](https://reader036.vdocument.in/reader036/viewer/2022070409/56649ea05503460f94ba35f1/html5/thumbnails/11.jpg)
File Access
Sequential – bytes read from beginning to end with no ability to skip.
Random – Bytes can be read out of order read operation – give position in a file to
start reading at. seek operation – sets the current
position
![Page 12: File Systems Long-term Information Storage Store large amounts of information Information must survive the termination of the process using it Multiple](https://reader036.vdocument.in/reader036/viewer/2022070409/56649ea05503460f94ba35f1/html5/thumbnails/12.jpg)
File Attributes
![Page 13: File Systems Long-term Information Storage Store large amounts of information Information must survive the termination of the process using it Multiple](https://reader036.vdocument.in/reader036/viewer/2022070409/56649ea05503460f94ba35f1/html5/thumbnails/13.jpg)
File Operations Create – file created and some
attributes set Delete – removes file Open – a process must open a file
before it is used. Fetches attributes Close – frees up space Read – Usually from current position
and caller must provide buffer
![Page 14: File Systems Long-term Information Storage Store large amounts of information Information must survive the termination of the process using it Multiple](https://reader036.vdocument.in/reader036/viewer/2022070409/56649ea05503460f94ba35f1/html5/thumbnails/14.jpg)
File Operations (cont.) Write – Usually written at the current
position Append – add data to the end of file Seek – specifies where to retrieve
data. Repositions file pointer (often used before a read or write)
Get Attributes/Set Attributes Rename
![Page 15: File Systems Long-term Information Storage Store large amounts of information Information must survive the termination of the process using it Multiple](https://reader036.vdocument.in/reader036/viewer/2022070409/56649ea05503460f94ba35f1/html5/thumbnails/15.jpg)
Directories
Used to keep track (organize) files in a logical manner.
Files themselves
![Page 16: File Systems Long-term Information Storage Store large amounts of information Information must survive the termination of the process using it Multiple](https://reader036.vdocument.in/reader036/viewer/2022070409/56649ea05503460f94ba35f1/html5/thumbnails/16.jpg)
Single-Level Directories
One directory containing all files for all users.
What are the problems?
A single level directory systemcontains 4 filesowned by 3 different people, A, B, and C
![Page 17: File Systems Long-term Information Storage Store large amounts of information Information must survive the termination of the process using it Multiple](https://reader036.vdocument.in/reader036/viewer/2022070409/56649ea05503460f94ba35f1/html5/thumbnails/17.jpg)
Two-Level Directory
What if we provided a directory for each user to store their files.
What does this solve? What is still desired?
![Page 18: File Systems Long-term Information Storage Store large amounts of information Information must survive the termination of the process using it Multiple](https://reader036.vdocument.in/reader036/viewer/2022070409/56649ea05503460f94ba35f1/html5/thumbnails/18.jpg)
Hierarchical Directory
Allows users to group their files in a logical manner (tree of directories)
![Page 19: File Systems Long-term Information Storage Store large amounts of information Information must survive the termination of the process using it Multiple](https://reader036.vdocument.in/reader036/viewer/2022070409/56649ea05503460f94ba35f1/html5/thumbnails/19.jpg)
Path Names
Absolute – specifies from the root directory the full path to the file
Relative – specifies file location from the current directory location
Working directory is another name for current directory
![Page 20: File Systems Long-term Information Storage Store large amounts of information Information must survive the termination of the process using it Multiple](https://reader036.vdocument.in/reader036/viewer/2022070409/56649ea05503460f94ba35f1/html5/thumbnails/20.jpg)
Path Names (cont.)
. (dot) – notion for current directory
.. (dot dot) – notion for parent directory of the current directory
These notions can be used when specifying a relative path
![Page 21: File Systems Long-term Information Storage Store large amounts of information Information must survive the termination of the process using it Multiple](https://reader036.vdocument.in/reader036/viewer/2022070409/56649ea05503460f94ba35f1/html5/thumbnails/21.jpg)
Paths (cont.)
![Page 22: File Systems Long-term Information Storage Store large amounts of information Information must survive the termination of the process using it Multiple](https://reader036.vdocument.in/reader036/viewer/2022070409/56649ea05503460f94ba35f1/html5/thumbnails/22.jpg)
Directory Operations (UNIX) Create – empty directory created Delete Opendir – opens a directory so that it can be
read Closedir Readdir – returns next entry in an open
directory Rename Link – Allows files to appear in more than one
directory Unlink – directory entry is removed