{"id":22894814,"url":"https://github.com/mathusanm6/c-treedir","last_synced_at":"2026-05-07T05:36:12.807Z","repository":{"id":209900346,"uuid":"721499485","full_name":"mathusanm6/C-TreeDir","owner":"mathusanm6","description":"Simulate file system operations on an in-memory tree structure, including creation, movement, and deletion of files and folders.","archived":false,"fork":false,"pushed_at":"2023-11-29T18:10:58.000Z","size":4899,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-24T10:59:43.611Z","etag":null,"topics":["bash","c","shell","shell-like","tree-structure"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mathusanm6.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-11-21T07:31:32.000Z","updated_at":"2023-11-29T17:58:25.000Z","dependencies_parsed_at":"2023-11-29T18:46:38.788Z","dependency_job_id":null,"html_url":"https://github.com/mathusanm6/C-TreeDir","commit_stats":null,"previous_names":["mathusanme/c-treedir","mathusanm6/c-treedir"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mathusanm6/C-TreeDir","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathusanm6%2FC-TreeDir","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathusanm6%2FC-TreeDir/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathusanm6%2FC-TreeDir/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathusanm6%2FC-TreeDir/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mathusanm6","download_url":"https://codeload.github.com/mathusanm6/C-TreeDir/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathusanm6%2FC-TreeDir/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32724834,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-07T02:14:30.463Z","status":"ssl_error","status_checked_at":"2026-05-07T02:14:29.405Z","response_time":62,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bash","c","shell","shell-like","tree-structure"],"created_at":"2024-12-13T23:19:54.965Z","updated_at":"2026-05-07T05:36:12.781Z","avatar_url":"https://github.com/mathusanm6.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TREEDIR - C Language Project\n[![C-Project Workflow](https://github.com/mathusanMe/C-TreeDir/actions/workflows/workflow.yaml/badge.svg)](https://github.com/mathusanMe/C-TreeDir/actions/workflows/workflow.yaml)\n\nThis project was made in 5 weeks during the 2nd year of my Bachelor's degree in Computer Science.\n\n## Table of Contents\n- [1. Project Description](#1-project-description)\n- [2. Gained Experience](#2-gained-experience)\n- [3. Screenshots](#3-screenshots)\n- [4. Project Structure](#4-project-structure)\n- [5. Usage Guide](#5-usage-guide)\n    - [a. For run.sh to Compile](#a-for-runsh-to-compile)\n    - [b. For ./program with a Text File](#b-for-program-with-a-text-file)\n\n## 1. Project Description\nThis project involved creating a C program that simulates a file system's tree structure. It manages folders and files using a tree stored in memory, operating on instructions from an input file. Key commands implemented include `ls`, `cd`, `mkdir`, `touch`, `rm`, `cp`, `mv`, and `print`, each with specific functionalities. **The emphasis is on robust error handling and dynamic memory management. The project offered practical experience in system-level programming in C.**\n\nThe project was completed in collaboration with [Yanis](https://github.com/YanisLcn) in approximately 5 weeks.\n\n## 2. Gained Experience\nThis project marked my initial foray into programming in C. Although it presented some initial challenges, it served as a valuable learning experience, particularly in the realms of memory management, pointer manipulation, and the significance of effective error handling. Furthermore, I acquired proficiency in employing Valgrind for memory leak detection. Given the time constraints, I did find myself working under pressure, but I take pride in the final outcome.\n\nWorking in a team of two was a new experience for me, and I found it to be a positive one. We were able to divide the work effectively, and we were able to learn from each other's strengths. I was able to gain a better understanding of the importance of communication and collaboration in a team setting.\n\n## 3. Screenshots\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"images/running_tests.png\" alt=\"Running Tests\"\u003e\n  \u003cbr\u003e\n  \u003csub\u003eRunning Tests\u003c/sub\u003e\n\u003c/p\u003e\n\n\u003cbr\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"images/valid_commands.png\" alt=\"Valid Commands\"\u003e\n  \u003cbr\u003e\n  \u003csub\u003eValid Commands\u003c/sub\u003e\n\u003c/p\u003e\n\n\u003cbr\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"images/invalid_commands.png\" alt=\"Invalid Commands\"\u003e\n  \u003cbr\u003e\n  \u003csub\u003eInvalid Commands\u003c/sub\u003e\n\u003c/p\u003e\n\n## 4. Project Structure\n```\n.\n├── src\n│   ├── commands\n│   │   ├── cd\n│   │   ├── cp\n│   │   ├── ls\n│   │   ├── mkdir\n│   │   ├── mv\n│   │   ├── pwd\n│   │   ├── rm\n│   │   └── touch\n│   ├── parser\n│   └── utils\n├── tests\n├── inputs\n├── run.sh\n└── Makefile\n```\n_inputs: Contains the text files used for testing (provided by instructors)._\n\n## 5. Usage Guide\n\n### a. For run.sh to Compile\nThis `run.sh` script allows you to compile, test, and execute the program.\n\nThe options you can use with this script are:\n\n* a: Forces a complete recompilation of the program by executing make clean before make all.\n* b: Activates verbose mode. By default, all outputs will be sent to standard output.\n* t: Performs tests after compiling the program.\n* v: Runs the program with Valgrind to check for memory leaks.\n* o: Redirects output to a file. For example, -o output.txt will send the output to the output.txt file.\n\n#### Examples\nHere are some examples of how to use this script:\n\n- To completely recompile the program:\n    ```bash\n    ./run.sh -a\n    ```\n\n- To compile the program and perform tests:\n    ```bash\n    ./run.sh -a -t\n    ```\n- To compile and run the program with more detailed output:\n    ```bash\n    ./run.sh -b\n    ```\n\n- To compile and run the program with Valgrind:\n    ```bash\n    ./run.sh -v\n    ```\n\nDon't forget to give execution permissions to the script with `chmod +x run.sh` if it's not already executable.\n\n### b. For ./program with a Text File\n\nCompiling with run.sh produces an executable program that can be used to run the program. It accepts several options, which you can combine as you see fit:\n\n-v: Activates verbose mode.\n-t: Executes built-in tests.\n-o: Redirects output to a file. For example, -o output.txt will send the output to the output.txt file.\n\n#### Examples\n- To run the program with a text file in verbose mode:\n    ```bash\n    ./program -v \u003ctext file\u003e\n    ```\n\n- To run the built-in tests in verbose mode:\n    ```bash\n    ./program -v -t\n    ```\n\n- To run the program with a text file and redirect output to a file:\n    ```bash\n    ./program -o output.txt \u003ctext file\u003e\n    ```\n\n- To run the built-in tests and redirect output to a file:\n    ```bash\n    ./program -t -o output.txt\n    ```\n\n- To launch Valgrind during the execution of the program with a text file, use the following command:\n    ```bash\n    valgrind ./program \u003ctext file\u003e\n    ```\n- A more detailed version of Valgrind can be obtained using the following command:\n    ```bash\n    valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes --verbose ./program \u003ctext file\u003e\n    ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmathusanm6%2Fc-treedir","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmathusanm6%2Fc-treedir","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmathusanm6%2Fc-treedir/lists"}