Skip to content

bhutuklearning/File-Management-System

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

C File Management System (FMS)

A powerful terminal-based file manager with colorized interface

Language Platform Version

FMS

🚀 Overview

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.

✨ Features

  • 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

📋 Commands

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

🔧 Installation

# 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

🛠️ From Scratch Setup

If you want to build the project from scratch:

  1. Create the project directory

    mkdir fms-project
    cd fms-project
  2. Create the required files

    Create terminal_gui.h:

  3. 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
  4. Run the program

    On Linux/Unix/macOS/WSL:

    ./fms

    On Windows:

    fms.exe
  5. Test basic commands

    help
    create-file test.txt
    read-file test.txt
    current-dir
    

    Folder Structure

    DIRECTRY LOOK

💻 Usage Examples

Creating and Writing to Files

create-file example.txt
write-file example.txt
# Enter text at the prompt
# Press Enter + Ctrl+D (Unix) or Ctrl+Z (Windows) to finish

Directory Navigation

create-dir documents
enter-dir documents
current-dir
exit-dir

File Management

copy-file source.txt backup.txt
search-file example.txt "search term"
metadata example.txt

🛠️ Technical Details

  • 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

📦 Dependencies

  • GCC compiler (version 4.8 or higher)
  • Standard C libraries
  • ANSI-compatible terminal
  • Windows: Windows API (for Windows-specific features)
  • Linux: POSIX-compliant system

⚠️ Troubleshooting

Common Issues and Solutions

  1. Color Display Issues

    • Problem: Colors not showing or displaying incorrectly
    • Solutions:
      1. Check terminal compatibility:
        echo $TERM  # Should return xterm-256color or similar
      2. Enable ANSI support:
        • Windows: Use Windows Terminal or enable ANSI in cmd.exe
        • Linux: Add export TERM=xterm-256color to your ~/.bashrc
      3. Run with no-color flag:
        ./fms --no-color
  2. Permission Errors

    • Problem: "Permission denied" or "Access denied" errors
    • Solutions:
      1. Check file permissions:
        # Linux/Unix
        ls -l <filename>
        # Windows
        icacls <filename>
      2. Fix permissions:
        # Linux/Unix
        chmod u+rw <filename>
        # Windows
        icacls <filename> /grant Users:F
      3. Run with appropriate privileges:
        • Linux: Use sudo if needed
        • Windows: Run as Administrator
  3. Compilation Errors

    • Problem: Build fails or missing dependencies
    • Solutions:
      1. Check GCC version:
        gcc --version  # Should be 4.8 or higher
      2. Install missing dependencies:
        # Ubuntu/Debian
        sudo apt-get install build-essential
        # Windows
        # Install MinGW-w64 with MSYS2
      3. Verify source files:
        ls *.c *.h  # Should show all required files
  4. File Operation Errors

    • Problem: File operations failing or unexpected behavior
    • Solutions:
      1. Check file existence:
        # Linux/Unix
        ls -la <filename>
        # Windows
        dir <filename>
      2. Verify file path:
        # Use absolute paths if needed
        /full/path/to/file
      3. Check file locks:
        • Close any programs that might be using the file
        • Wait a few seconds and try again
  5. Memory Issues

    • Problem: Program crashes with large files
    • Solutions:
      1. Check available memory:
        # Linux
        free -h
        # Windows
        systeminfo | findstr "Available Physical Memory"
      2. Use smaller file chunks:
        • Split large files before processing
        • Process files in smaller batches
      3. Monitor system resources:
        • Close unnecessary applications
        • Free up disk space if needed

Getting Additional Help

If you're still experiencing issues:

  1. Check the Issues page
  2. Create a new issue with:
    • Detailed error message
    • Steps to reproduce
    • System information
    • Screenshots if applicable

🚀 Performance Considerations

  • 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

📝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

🙏 Acknowledgements

  • Inspired by classic file managers like Midnight Commander
  • Thanks to all contributors who have helped shape this project

📸 Screenshots

FMS Commands FMS Working

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

About

Terminal based File Management System.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages