A terminal-based file management system, written in C, which is used to carry out various operations on files and directories. An intuitive command interface and colorized output make it easy and efficient in managing files. This is cross-platform application works smoothly on both Linux and Windows.
- File Operations: Create, read, write, delete, copy, and rename files
- Directory Management: Create, navigate, list, and delete directories
- Search Capabilities: Find text within files
- System Information: Display detailed system stats
- Colorized Interface: Visual differentiation between operation types
- Cross-Platform: Works on Windows and UNIX-based systems
Category | Command | Description |
---|---|---|
File Operations | create-file <filename> |
Create a new file |
write-file <filename> |
Append text to a file | |
overwrite-file <filename> |
Replace file contents | |
read-file <filename> |
Display file contents | |
delete-file <filename> |
Remove a file | |
copy-file <source> <dest> |
Copy a file | |
rename-file <old> <new> |
Rename a file | |
search-file <file> <term> |
Search text in a file | |
metadata <filename> |
Show file details | |
Directory Operations | create-dir <dirname> |
Create a directory |
delete-dir <dirname> |
Remove a directory | |
list-dir <dirname> |
List directory contents | |
Navigation | show-path |
Show current path |
enter-dir <dirname> |
Change directory | |
exit-dir |
Move up one level | |
System | system-info |
Display system information |
help |
Show command usage | |
exit |
Exit the application |
# Clone the repository
git clone https://github.com/yourusername/c-file-management-system.git
# Navigate to the project directory
cd c-file-management-system
# Compile the program (Unix/Linux/WSL)
gcc fms.c terminal_gui.c platform.c -o fms
# On Windows
gcc fms.c terminal_gui.c platform.c -o fms.exe
If you want to build the project from scratch:
-
Create the project directory
mkdir fms-project cd fms-project
-
Create the required files
Create
terminal_gui.h
: -
Compile the program
On Linux/Unix/macOS/WSL:
gcc -o fms fms.c terminal_gui.c platform.c
On Windows:
gcc -o fms.exe fms.c terminal_gui.c platform.c
-
Run the program
On Linux/Unix/macOS/WSL:
./fms
On Windows:
fms.exe
-
Test basic commands
help create-file test.txt read-file test.txt current-dir
Folder Structure
create-file example.txt
write-file example.txt
# Enter text at the prompt
# Press Enter + Ctrl+D (Unix) or Ctrl+Z (Windows) to finish
create-dir documents
enter-dir documents
current-dir
exit-dir
copy-file source.txt backup.txt
search-file example.txt "search term"
metadata example.txt
- Written in pure C for maximum performance and minimal footprint
- Uses standard C libraries for cross-platform compatibility
- Implements ANSI color codes for terminal visualization
- Platform-specific code is abstracted for portability
- GCC compiler (version 4.8 or higher)
- Standard C libraries
- ANSI-compatible terminal
- Windows: Windows API (for Windows-specific features)
- Linux: POSIX-compliant system
-
Color Display Issues
- Problem: Colors not showing or displaying incorrectly
- Solutions:
- Check terminal compatibility:
echo $TERM # Should return xterm-256color or similar
- Enable ANSI support:
- Windows: Use Windows Terminal or enable ANSI in cmd.exe
- Linux: Add
export TERM=xterm-256color
to your ~/.bashrc
- Run with no-color flag:
./fms --no-color
- Check terminal compatibility:
-
Permission Errors
- Problem: "Permission denied" or "Access denied" errors
- Solutions:
- Check file permissions:
# Linux/Unix ls -l <filename> # Windows icacls <filename>
- Fix permissions:
# Linux/Unix chmod u+rw <filename> # Windows icacls <filename> /grant Users:F
- Run with appropriate privileges:
- Linux: Use
sudo
if needed - Windows: Run as Administrator
- Linux: Use
- Check file permissions:
-
Compilation Errors
- Problem: Build fails or missing dependencies
- Solutions:
- Check GCC version:
gcc --version # Should be 4.8 or higher
- Install missing dependencies:
# Ubuntu/Debian sudo apt-get install build-essential # Windows # Install MinGW-w64 with MSYS2
- Verify source files:
ls *.c *.h # Should show all required files
- Check GCC version:
-
File Operation Errors
- Problem: File operations failing or unexpected behavior
- Solutions:
- Check file existence:
# Linux/Unix ls -la <filename> # Windows dir <filename>
- Verify file path:
# Use absolute paths if needed /full/path/to/file
- Check file locks:
- Close any programs that might be using the file
- Wait a few seconds and try again
- Check file existence:
-
Memory Issues
- Problem: Program crashes with large files
- Solutions:
- Check available memory:
# Linux free -h # Windows systeminfo | findstr "Available Physical Memory"
- Use smaller file chunks:
- Split large files before processing
- Process files in smaller batches
- Monitor system resources:
- Close unnecessary applications
- Free up disk space if needed
- Check available memory:
If you're still experiencing issues:
- Check the Issues page
- Create a new issue with:
- Detailed error message
- Steps to reproduce
- System information
- Screenshots if applicable
- Optimized for small to medium-sized files
- Large file operations may take longer
- Directory listing performance depends on number of files
- Memory usage scales with file size during operations
- Recommended for files under 1GB for optimal performance
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
- Inspired by classic file managers like Midnight Commander
- Thanks to all contributors who have helped shape this project
The colorized interface makes it easy to distinguish between different operation types:
- 🟩 Green: File operations
- 🟦 Blue: Directory operations
- 🟨 Yellow: System operations
- 🟪 Magenta: Other operations
This project is actively maintained. Last updated: April 2025