Download presentation
Presentation is loading. Please wait.
Published byJustin Hubbard Modified over 9 years ago
1
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.
2
File System Part of the OS that manages these aspects of files Structuring Naming Accessing Using Protecting Implemented
3
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
4
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
5
Common File Extensions and Meanings
6
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)
7
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
8
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
9
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)
10
Binary (Executable and Archive)
11
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
12
File Attributes
13
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
14
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
15
Directories Used to keep track (organize) files in a logical manner. Files themselves
16
Single-Level Directories One directory containing all files for all users. What are the problems? A single level directory system contains 4 files owned by 3 different people, A, B, and C
17
Two-Level Directory What if we provided a directory for each user to store their files. What does this solve? What is still desired?
18
Hierarchical Directory Allows users to group their files in a logical manner (tree of directories)
19
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
20
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
21
Paths (cont.)
22
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
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.