A C-based simulation of a file management system that demonstrates various file organization and memory management concepts.
This project implements a file system simulator that supports both contiguous and chained file organization methods. It provides functionality for:
- Memory initialization and management
- File creation and deletion
- Record insertion and deletion
- Memory defragmentation and compaction
- File metadata management
- Memory state visualization
- Flexible Memory Configuration: Users can specify total blocks and block size
- Dual File Organization:
- Contiguous allocation
- Chained allocation
- Record Management:
- Support for sorted and unsorted record organization
- Record insertion with unique IDs
- Record deletion with space reclamation
- Memory Optimization:
- File defragmentation
- Memory compaction
- Block allocation tracking
- System Visualization:
- Color-coded memory state display
- Detailed metadata information
- Block allocation status
file_systeme_sfsd/
├── file_system.c # Core file system implementation
├── file_system.h # Header file with data structures
├── main.c # Program entry point
├── menu.c # User interface implementation
├── menu.h # Menu function declarations
├── build/ # Compiled objects and executable
├── Makefile # Build configuration
└── README.md # Project documentation
- GCC compiler
- Make build system
- Unix-like environment (Linux/macOS) or Windows with MinGW
-
Clone the repository:
git clone https://github.com/wailbentafat/file_systeme_sfsd.git cd file_systeme_sfsd
-
Build the project:
make
-
Run the simulator:
make run
-
Initialize Memory:
- Select option 1
- Enter total number of blocks
- Enter block size (records per block)
-
Create a File:
- Select option 2
- Enter filename
- Specify number of records
- Choose organization method:
- Global: Contiguous (0) or Chained (1)
- Internal: Sorted (0) or Unsorted (1)
-
Manage Records:
- Insert records with option 6
- Delete records with option 7
- Search records with option 5
-
Optimize Memory:
- Defragment individual files with option 8
- Compact entire memory with option 11
-
Monitor System State:
- View memory state with option 3
- Check file metadata with option 4
- Dynamic allocation of blocks and records
- Efficient block allocation tracking
- Automatic memory cleanup
- Contiguous: Files stored in consecutive blocks
- Chained: Blocks linked using next-block pointers
- Unique record IDs
- Soft deletion for efficient space reuse
- Support for both sorted and unsorted organizations
To remove built files:
make clean
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
MIT License