{"id":21763202,"url":"https://github.com/vrutik21/sockdfs","last_synced_at":"2026-05-16T21:32:53.541Z","repository":{"id":253478263,"uuid":"843630394","full_name":"Vrutik21/SockDFS","owner":"Vrutik21","description":"This project implements a distributed file system with three servers (Smain, Spdf, Stext) and a client (client24s) using socket programming. The system supports multiple client connections, enabling upload, download, and management of .c, .txt, and .pdf files across different servers seamlessly, with clients interacting only with the main server.","archived":false,"fork":false,"pushed_at":"2024-08-19T07:19:24.000Z","size":13,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-26T01:27:27.127Z","etag":null,"topics":["c","linux","shell-scripting","socket-programming","unix"],"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/Vrutik21.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-17T00:38:57.000Z","updated_at":"2024-08-20T05:32:20.000Z","dependencies_parsed_at":"2024-08-17T02:35:53.114Z","dependency_job_id":null,"html_url":"https://github.com/Vrutik21/SockDFS","commit_stats":null,"previous_names":["vrutik21/sockdfs"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vrutik21%2FSockDFS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vrutik21%2FSockDFS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vrutik21%2FSockDFS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vrutik21%2FSockDFS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Vrutik21","download_url":"https://codeload.github.com/Vrutik21/SockDFS/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244739940,"owners_count":20501990,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["c","linux","shell-scripting","socket-programming","unix"],"created_at":"2024-11-26T12:14:35.758Z","updated_at":"2026-05-16T21:32:48.505Z","avatar_url":"https://github.com/Vrutik21.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Distributed File System (Using Socket Programming)\n\n## Project Overview\n\nThis project implements a distributed file system using socket programming. The system is composed of three servers—Smain, Spdf, and Stext—and multiple clients. The Smain server acts as the main server that handles all client requests, while Spdf and Stext servers are responsible for handling `.pdf` and `.txt` files, respectively.\n\n### Key Features:\n\n- **Multi-Client Support:** The system supports multiple clients simultaneously, each communicating only with the Smain server.\n- **File Distribution:** Clients upload `.c`, `.pdf`, and `.txt` files to Smain. The Smain server stores `.c` files locally and forwards `.pdf` and `.txt` files to the Spdf and Stext servers, respectively, without the client's awareness.\n- **Command Processing:** Clients can upload, download, delete files, create tar archives, and display file lists using custom commands.\n\n## Project Structure\n\nThe project consists of the following main components:\n\n1. **Smain.c:** Handles client connections and manages file distribution between the main server and auxiliary servers.\n2. **Spdf.c:** Dedicated server for storing and managing `.pdf` files.\n3. **Stext.c:** Dedicated server for storing and managing `.txt` files.\n4. **client24s.c:** Client-side program that interacts with the Smain server to perform various file operations.\n\n## Commands\n\nThe client can use the following commands to interact with the distributed file system:\n\n### 1. `ufile filename destination_path`\n\n- **Description:** Uploads a file from the client's working directory to the specified path on the Smain server.\n- **Parameters:**\n  - `filename`: Name of the file to upload (`.c`, `.pdf`, `.txt`).\n  - `destination_path`: Destination path on Smain (`~/smain`).\n- **Example:**\n  ```bash\n  ufile sample.c ~/smain/folder1/folder2\n  ```\n\n### 2. `dfile filename`\n\n- **Description:** Downloads a file from the Smain server to the client's working directory.\n- **Parameters:**\n  - `filename`: Name of the file to upload (`.c`, `.pdf`, `.txt`).\n- **Example:**\n  ```bash\n  dfile ~/smain/folder1/folder2/sample.pdf\n  ```\n\n### 3. `rmfile filename`\n\n- **Description:** Deletes a file from the Smain server.\n- **Parameters:**\n  - `filename`: Path of the file to delete (`.c`, `.pdf`, `.txt`).\n- **Example:**\n  ```bash\n  rmfile ~/smain/folder1/folder2/sample.txt\n  ```\n\n### 4. `dtar filetype`\n\n- **Description:** Creates a tar archive of all files of the specified type and downloads the tar file to the client's working directory.\n- **Parameters:**\n  - `filetype`: File type to archive (`.c`, `.pdf`, `.txt`).\n- **Example:**\n  ```bash\n  dtar .pdf\n  ```\n\n### 5. `display pathname`\n\n- **Description:** Displays a list of all .c, .pdf, and .txt files in the specified directory on the Smain server.\n- **Parameters:**\n  - `pathname`: Path of the directory on Smain (`~/smain`).\n- **Example:**\n  ```bash\n  display ~/smain/folder1/folder2\n  ```\n\n## Setup and Execution\n\n### Prerequisites\n\n- **Linux-based operating system**\n- **GCC compiler**\n\n### Steps to Run\n\n#### 1. Compile the server and client programs:\n\n```bash\ngcc -o smain Smain.c\ngcc -o spdf Spdf.c\ngcc -o stext Stext.c\ngcc -o client client24s.c\n```\n\n#### 2. Run the servers on separate terminals:\n\n```bash\n./smain\n./spdf\n./stext\n```\n\n#### 3. Run the client:\n\n```bash\n./client\n```\n\n## Project Submission\n\n### This project is submitted as part of the COMP-8567:Advanced Systems Programming course for the Summer 2024 session. It involves demonstrating the project during a scheduled slot and undergoing a viva.\n\n## Authors\n\n- **Vrutik Parmar**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvrutik21%2Fsockdfs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvrutik21%2Fsockdfs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvrutik21%2Fsockdfs/lists"}