Chapter2_File_System_Introduction_1
Chapter2_File_System_Introduction_1
Operating system
Access Methods
File operations
Folder
Folder Definition
Folder operations
Folder structure
Acyclic graph
Directory name
Inside folder Organizer
1. Definitions
2. File access methods
3. File Operations (các thao tác với file)
4. Folder
5. File volume allocation
6. Disks management
7. File systems robustness
8. File systems security
9. FAT files system
▶ File attributes:
• File name
• File type
• File volume
• File creater, owner
• File access permission
• Thời gian tạo file, sửa file, truy cập lần cuối File created, edit time,
last edited time
• File location
▶ File name:
• Identify files.
• Most used informtion when users work with files.
• Rules of file names:
• Disadvantages:
▶ Size up the system volume/
▶ Reduce the flexibility of system.
▶ Direct access:
• File is considered as numbered blocks/logs.
• Blocks can be accessed by arbitrary order.
• For instance: it can read 50th block, then 13th and 101th.
• Direct access is based on disk access characteristics, which allows ac-
cessing to any block.
• File is allocated at different blocks in disk, which allows non-sequential
access.
▶ OS regulate operations that users and applications can work with files.
▶ Most used operations are:
• Create file: create empty file; File is allocated the space with attributes
such as created time, name, user.
• Delete file:
▶ Free up the space that file takes in the disk.
▶ Free up the file in folder.
▶ Free up the space can simply mark as free space.
• Open file:
▶ Before read/write file.
▶ Read file attributes in the disks to speed up the next read/write oper-
ation.
• Close file:
▶ Delete file information in the memory table to give a space for coming
file.
▶ Many OS restrict the number of opened files at the same time, so close
the accessed file is important.
• Write to file:
▶ Data is written at the current position in file.
▶ If the current position is at the end of file, information is added and
the file volume increase.
▶ If the current position is not at the end, information will be overwritten.
• Lock file: When many processes change file content, it may result in
unexpected results, so OS allow locking file. When a process opens
file, it can request to lock file and do not allow other processes access,
read or write that file.
▶ The number of files stored in the disks is huge => need to organize
files for easy management and access.
▶ Disk is assigned into partition/volume (logic disk).
• All file properties are stored in folder. File contain content only =>
volume of entries, folder is big.
• A part of properties is stored with file content. Folder only store nec-
essary information for finding file location => volume is decreased
▶ Open file:
• OS find in folder/entry mapping to file name.
• Read properties and location of file in table containing opened files.
• If entry mapping to another file structure of file properties, this struc-
ture will be written in the table.
▶ File searching: folder structure allow searching with file name.
▶ File create: create new entry and add in folder.
▶ File delete: information of file and entry will be deleted from folder.
▶ Folder list: list files and information of that entry.
▶ Change name: only work with folder, not file content.
▶ 0: file entry
▶ Acyclic graph:
▶ Create the copies of shared files and store in different folder => ensure
the synthesis and consistency => avoid cross back-up, store one file
many times.
▶ List:
• Organize folder as the list of entries.
• Search entries by scanning the list
• Add new file in folder:
▶ Scan folder to check the existing of file name
▶ New entry is added at the end of the list or one cell in the table
▶ Binary tree:
• Increase searching speed thanks to structured data.
• NTFS file system of WinNT
▶ hash table:
• Use hash function to find location of entry in folder by file name.
• Quick searching time
• Hash function depends on the size of hash table => fixed hash table
size.
Chapter 2
▶ Definitions
▶ File access methods
▶ File operations
▶ Folder
Next