File Management System - OS
File Management System - OS
File Management
The File Manager (or File Management
System) is the manager in the Operating
System that creates the illusion that there are
files and folders being stored in computer
memory.
Files and
Operating System Folders
Memory
Hardware Locations
Hard Disk Block
Hard Disk Block
Hard Disk Block
Hard Disk Block
Hard Disk Block
The File Manager
◦ Keeps track of where files are stored
◦ Determines how the files are stored
◦ Follows operating system file allocation policies
◦ Uses available storage space efficiently for files
◦ Creates a record/log of all file usage
◦ Allocates a file to a user if is free, and if they are
permitted access to it.
◦ De-allocates file when user finished with it.
The file manager ALLOCATES a file by reading
it from the hard disk and loading it into
memory while updating its record of who is
using what file.
◦ CREATE
◦ OPEN
◦ DELETE
◦ RENAME
◦ COPY
◦ etc.
The name of a file is usually in two parts:
The name of a file is usually in two parts:
◦ MakeABackup.bat
The name of a file is usually in two parts:
◦ MakeABackup.bat
Filename
The name of a file is usually in two parts:
◦ MakeABackup.bat
Filename extension
.avi Microsoft Video for Windows movie
C:\WINDOWS\system32\MakeABackup.bat
Filename extension
The full filename includes path information:
C:\WINDOWS\system32\MakeABackup.bat
C:\WINDOWS\system32\MakeABackup.bat
C:\WINDOWS\system32\BackupFolder\
..\MakeABackup.bat
If I am in the following folder:
C:\WINDOWS\system32\BackupFolder\
..\MakeABackup.bat
The Operating System store files as records in memory,
where many records make up a single file.
We do a sequential search.
a b c d e f g h v wx y z
a b c d e f g h v wx y z
a b c d e f g h v wx y z
a b c d e f g h v wx y z
a b c d e f g h v wx y z
a b c d e f g h v wx y z
a b c d e f g h v wx y z
a b c d e f g h v wx y z
a b c d e f g h v wx y z
a b c d e f g h v wx y z
a b c d e f g h v wx y z
a b c d e f g h v wx y z
a b c d e f g h v wx y z
a b c d e f g h v wx y z
a b c d e f g h v wx y z
a b c d e f g h v wx y z
a b c d e f g h v wx y z
a b c d e f g h v wx y z
a b c d e f g h v wx y z
a b c d e f g h v wx y z
a b c d e f g h v wx y z
a b c d e f g h v wx y z
a b c d e f g h v wx y z
a b c d e f g h v wx y z
a b c d e f g h v wx y z
a b c d e f g h v wx y z
a b c d e f g h v wx y z
a b c d e f g h v wx y z
a b c d e f g h v wx y z
a b c d e f g h v wx y z
a b c d e f g h v wx y z
a b c d e f g h v wx y z
a b c d e f g h v wx y z
a b c d e f g h v wx y z
INDEX BLOCK:
File Address Size Next
File 1 1 4 9
File 1 9 4 -
File 2 15 5 -
a b c d e f g h v wx y z
INDEX BLOCK:
File Address Size Next
File 1 1 4 9
File 1 9 4 -
File 2 15 5 -
a b c d e f g h v wx y z
INDEX BLOCK:
File Address Size Next
File 1 1 4 9
File 1 9 4 -
File 2 15 5 -
a b c d e f g h v wx y z
INDEX BLOCK:
File Address Size Next
File 1 1 4 9
File 1 9 4 -
File 2 15 5 -
a b c d e f g h v wx y z
INDEX BLOCK:
File Address Size Next
File 1 1 4 9
File 1 9 4 -
File 2 15 5 -
This support both sequential and direct access to
records, and for larger files there can be multiple
indexes.
The Access Control Matrix shows the access
that each user has for each file on the
system. The possible accesses are:
◦ R: Read
◦ W: Write
◦ E: Execute
◦ D:Delete
Use Use Use Use Use
r r r r r
1 2 3 4 5
File 1 RWED --E- --E- RWED R---
◦ R: Read
◦ W: Write
◦ C: Change
◦ F: Full Control
In DOS access to a file can assigned to one of
two groups:
User
User Group
In DOS if we want to grant permissions to file,
e.g. MakeABackup.bat, we do:
cacls
In DOS if we want to grant permissions to file,
e.g. MakeABackup.bat, we do:
cacls filename
arguments
In DOS if we want to grant permissions to
file, e.g. MakeABackup.bat, we do:
◦ R: Read
◦ W: Write
◦ X: Execute
In Linux/Unix access to a file can assigned to
one of three groups:
User
User Group
World
In Linux/Unix access to a file can assigned to
one of three groups:
User -you
User Group – everyone in your group
World – everyone with a login to the system
In Linux/Unix access to a file can assigned to
one of three groups:
-rwxrwxrwx
-rwxrwxrwx
-
111111111
In Linux/Unix access to a file can assigned to
one of three groups:
-rwxr-xr-x
-
111101101
In Linux/Unix access to a file can assigned to
one of three groups:
-rwx--x--x
-
101001001
In Linux/Unix access to a file can assigned to
one of three groups:
-rwxrwxrwx
-111111111
- 7 7
7
In Linux/Unix access to a file can assigned to
one of three groups:
-rwxr-xr-x
-111101101
- 7 5 5
In Linux/Unix access to a file can assigned to
one of three groups:
-rwx--x--x
-111001001
- 7 1 1
If we want to grant permissions to file, e.g.
MakeABackup.bat, we do:
drwxrwxrwx
User User Group World