File management
Publié le 09/11/2025
Extrait du document
«
FILE MANAGEMENNT
File Systems – File System Interface and File System Structure
I.
Introduction to File Systems
A.
Definition: A file system is a method used by operating systems to organize, store, and retrieve
files on a storage medium (e.g., hard disk, SSD).
B.
File systems provide a logical structure for files, ensuring efficient storage and retrieval of data.
C.
Key components of a file system include the file system interface and the file system structure.
II.
File System Interface
A.
The file system interface defines the operations that can be performed on files and directories.
These operations include:
1.
File creation: Creating a new file with a specified name.
2.
File deletion: Removing a file from the file system.
3.
File opening and closing: Opening a file for reading or writing and closing it when finished.
4.
File reading and writing: Reading data from a file or writing data to a file.
5.
File positioning: Moving the current position within a file.
6.
File truncation: Shortening a file to a specified length.
7.
File attributes: Retrieving and modifying file attributes such as permissions, ownership, and
creation/modification timestamps.
8.
Directory creation and deletion: Creating and removing directories.
9.
Directory listing: Retrieving a list of files and subdirectories in a directory.
10.
File system mounting and unmounting: Connecting and disconnecting a file system to/from
the operating system.
B.
File Descriptors
1.
File descriptors are used by operating systems to represent open files.
2.
Each process has a file descriptor table that maps file descriptors to open files.
3.
File descriptors are used to perform file operations such as reading, writing, and seeking.
1
C.
File System Implementation Techniques
1.
Contiguous Allocation:
- Files are stored as contiguous blocks on the storage medium.
- Simple and efficient for sequential access but suffers from fragmentation.
2.
Linked Allocation:
- Files are divided into blocks, and each block contains a pointer to the next block.
- No fragmentation, but random access is slow.
3.
Indexed Allocation:
- Each file has an index block that contains pointers to the actual blocks of the file.
- Allows for efficient random access but requires additional space for the index block.
III.
File System Structure
A.
Boot Block
1.
The boot block is the first block on a storage device and contains boot code.
2.
The boot code is loaded into memory during system startup and is responsible for initializing
the operating system and loading the file system.
B.
Superblock
1.
The superblock contains metadata about the file system, such as the total number of blocks,
free blocks, and the size of the inode table.
2.
Inodes: Inode stands for “index node” and represents a file or directory.
- Each inode contains metadata about a file, such as its size, permissions, timestamps, and
pointers to the data blocks.
- Inodes are stored in the inode table.
- The inode number uniquely identifies each file or directory.
C.
Data Blocks
1.
Data blocks store the actual contents of files and directories.
2.
Various allocation techniques can be used to manage data blocks (e.g., contiguous, linked,
indexed).
2
D.
Directory Structure
1.
Directories organize files and other directories into a hierarchical structure.
2.
Each directory contains a list of entries, which associate a filename with an inode number.
3.
Directory entries typically include metadata such as the file type and file name.
E.
File System Operations
1.
File System Initialization: Formatting a storage device and creating the initial file system
structures (superblock, inode table, root directory).
2.
File Allocation: Allocating data blocks to files based on the chosen allocation technique.
3.
File System Maintenance: Managing free blocks, updating metadata, and handling file system
errors.
4.
File System Verification: Checking the integrity of the file system structures to detect and
repair inconsistencies.
Organization – Files and Directories
I.
Introduction to File Organization
A.
File organization refers to the way files are structured and stored within a file system.
B.
Proper file organization is crucial for efficient storage, retrieval, and management of data.
C.
Two key components of file organization are files and directories.
II.
Files
A.
Definition: A file is a named collection of related information that is stored on a storage device.
B.
Files can represent various types of data, including text documents, images, videos, executables,
and more.
C.
File Attributes
1.
Name: The name of the file, which is used to uniquely identify it within a directory.
2.
Identifier: A unique identifier assigned to the file by the file system.
3.
Type: The type of the file (e.g., text, image, audio).
3
4.
Location: The physical location of the file on the storage device.
5.
Size: The size of the file in bytes.
6.
Protection: The access permissions and security settings associated with the file.
7.
Timestamps: The timestamps indicating when the file was created, last modified, and last
accessed.
8.
Other metadata: Additional information about the file, such as owner, group, and file format.
III.
Directories
A.
Definition: A directory is a container that organizes files and subdirectories in a hierarchical
structure.
B.
Directories provide a way to group related files and facilitate navigation and organization within
a file system.
C.
Directory Operations
1.
Directory Creation: Creating a new directory within an existing directory.
2.
Directory Deletion: Removing a directory and its contents from the file system.
3.
Directory Traversal: Navigating through directories to access files and subdirectories.
4.
Directory Renaming: Changing the name of a directory.
5.
Directory Listing: Retrieving a list of files and subdirectories within a directory.
IV.
Hierarchical Directory Structure
A.
The hierarchical directory structure is the most commonly used organization method in file
systems.
B.
In this structure, directories are organized in a tree-like hierarchy, with a single root directory
at the top.
C.
Each directory (except the root) can have a parent directory and zero or more subdirectories.
D.
Files are stored within directories and can have unique names within their respective directories.
V.
Pathnames
A.
Pathnames are used to specify the location of a file or directory within a file system.
4
B.
Absolute Pathname: A complete path that specifies the location of a file or directory from the
root directory.
C.
Relative Pathname: A path that specifies the location of a file or directory relative to the current
working directory.
D.
Pathname Components: Pathnames are composed of directory names separated by a delimiter
(e.g., forward slash ‘/’).
E.
Special Pathnames:
1.
“.” (dot): Refers to the current directory.
2.
“..” (dot-dot): Refers to the parent directory.
VI.
File System Navigation
A.
Changing the Current Working Directory: Users can change their current working directory to
navigate through the file system.
B.
Relative and Absolute Pathnames: Users can specify the location of files or directories using
relative or absolute pathnames.
C.
Path Resolution: The process of converting a pathname into a specific file or directory location
within the file system.
Some examples to illustrate certain parts of the lecture notes on Organization: Files and
Directories:
1.
File Attributes:
- Name: “report.docx”
- Identifier: 12345
- Type: Microsoft Word document
- Location: C:\Documents\report.docx
- Size: 2.5 MB
- Protection: Read and Write permissions for the owner, Read-only for others
- Timestamps: Created: 2023-10-15, Last Modified: 2023-11-30, Last Accessed: 2024-01-05
- Other metadata: Owner: John Smith, File Format: DOCX
5
2.
Directories:
- Directory Creation: Creating a new directory named “Photos” within an existing directory.
- Directory Deletion: Removing the directory “OldFiles” and its contents from the file system.
- Directory Traversal: Navigating through directories to access files and subdirectories, e.g.
accessing “C:\Documents\Reports\2023\Q4\sales_report.xlsx”
- Directory Renaming: Changing the name of a directory from “Work” to “Projects”.
- Directory Listing: Retrieving a list of files and subdirectories within a directory, e.g.
listing the
contents of the directory “C:\Documents”.
3.
Hierarchical Directory Structure:
- Root directory: “/”
- Subdirectories: “home”, “documents”, “photos”, “music”
- Files within “documents”: “report.docx”, “presentation.pptx”
- Files within “photos”: “vacation.jpg”, “family.jpg”
- Files within “music”: “song1.mp3”, “song2.mp3”
- Example absolute path: “/documents/report.docx”
- Example relative path: “../photos/vacation.jpg”
4.
Pathnames:
- Absolute Pathname: “/home/user/documents/report.docx”
- Relative Pathname: “../photos/family.jpg”
- Pathname Components: “home”, “user”, “documents”, “report.docx”
5.
File System Navigation:
- Changing the Current Working Directory: Changing the current working directory from
“/home” to “/home/user/documents”.
- Relative and Absolute Pathnames: Accessing the file “presentation.pptx” using the relative
pathname
“../presentation.pptx”
or
the
absolute
pathname
“/home/user/documents/presentation.pptx”.
6
- Path Resolution: Resolving the pathname “../photos/vacation.jpg” to the specific file location
“C:\Documents\Photos\vacation.jpg” within the file system.
Secondary Storage Management – File Systems: FAT and NTFS
I.
Introduction to Secondary Storage Management
A.
Secondary storage refers to non-volatile storage devices used for long-term data storage, such
as hard disk drives (HDDs) and solid-state drives (SSDs).
B.
Secondary storage management involves organizing and managing data on these storage
devices efficiently and reliably.
C.
File systems are responsible for providing the interface and structure for storing and accessing
files on secondary storage.
II.....
»
↓↓↓ APERÇU DU DOCUMENT ↓↓↓
Liens utiles
- Advanced Management Amazon
- BRAND MANAGEMENT
- management.
- cours management
- Fiche lecture: Thérèse RaquinBiographieÉmile Zola (18401902) est un écrivain, critique littéraire et journaliste français, considéré comme le chef de file du naturalisme.