File System Interface
File System Interface
Objectives
abbreviated as FS
method of organizing and retrieving files from a storage medium
usually consist of files separated into groups called directories
Directories can contain files or additional directories
commonly used file system with Windows is NTFS.
File Attributes
A file’s attributes vary from one operating system to another but typically consist of these:
Name: The symbolic file name is the only information kept in human readable form
Identifier: usually a number, identifies the file within the file system
it is the non-human-readable name for the file
File Attributes cont..
Type: This information is needed for systems that support different types of files
Location: This information is a pointer to a device and to the location of the file on
that device
Size: The current size of the file (in bytes, words, or blocks) and possibly the maximum
allowed size are included in this attribute.
File Attributes cont..
These files contain list of file names and other information related to these files.
Special files
these files are also known as device files.
These files represent physical device like disks, terminals, printers, networks, tape drive
etc
File operations
File operations:
Create a file
Open a file
Write a file
Read a file
Close a file
Truncate a file
File operations cont..
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
system needs to keep a read pointer to the location in the file where the next read is to take
place
Deleting a file: To delete a file, search the directory for the named file.
erase the directory entry
File operations cont..
truncating a file:The user may want to erase the contents of a file but keep its attribute
this function allows all attributes to remain unchanged
File Access Mechanisms
Sequential access
Direct/Random access
Indexed sequential access
Sequential access
file sharing is desirable for users who want to collaborate and to reduce the effort required
to achieve a computing goal
Multiple users can share files
When an OS accommodates multiple users, the issues of file sharing, file naming, and file
protection become preeminent.
File Protection
by physically removing the floppy disks and locking them in a desk drawer or file cabinet
provide controlled access by limiting the types of file access
associate a password with each file
Type of access
If that user is listed for the requested access, the access is allowed
Otherwise, a protection violation occurs
End of chapter