Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

5 Commits

Folders and files

Repository files navigation

C-Based In-Memory Filesystem Emulator

This project is a C implementation of an in-memory filesystem that emulates the core concepts of a traditional Linux filesystem. It demonstrates the use of fundamental data structures like inodes and directory entries to manage a hierarchical structure of files and directories, all handled dynamically in memory.

Technical Features

Filesystem Architecture

The emulator is built around two primary data structures:

  • inode: A structure that serves as the metadata container for every file and directory. It stores essential information such as file type (regular file or directory), permissions, size, and pointers to the data blocks that hold the actual content.

  • Directory Entry: A structure that links human-readable filenames to their corresponding inode numbers, forming the directory hierarchy.

All filesystem components are allocated dynamically on the heap, and their relationships are managed through pointers.

Core Functionality

The project implements a suite of standard filesystem operations, providing a functional command-line interface to interact with the in-memory structure:

  • File & Directory Creation (touch, mkdir): Dynamically allocates a new inode and links it into the parent directory's data blocks. For directories, it correctly initializes the . and .. entries to maintain the hierarchical structure.

  • Directory Listing (ls): Traverses a directory's linked list of data blocks, reading each directory entry to display the names of its contents.

  • File & Directory Removal (rm, rmdir): Deallocates all data blocks associated with an inode, frees the inode itself, and removes its entry from the parent directory, ensuring no memory leaks.

  • File Content Operations (write, read): Simulates writing to and reading from files by managing and accessing the content stored in the associated data blocks.

This project showcases a deep understanding of C-based memory management, data structure design, and the foundational principles of filesystem architecture.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages

Generated from BatDan24/cse220_hw2