# gnelshahnazaryan/file_system_c architecture

> Architecture diagram of the GitHub repository gnelshahnazaryan/file_system_c, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/gnelshahnazaryan/file_system_c
- Repository: https://github.com/gnelshahnazaryan/file_system_c

## Overview

File_System_C is a menu-driven C program for managing person records in a binary file and exporting them to text. The principal workflow is a user choosing an operation, the CLI dispatching to a record operation, and that operation reading or changing the binary store; export additionally writes a text document. The operations cover adding, listing, searching, updating, removing, counting, and resetting records. The README contains only the project name, so this map is based on the sampled source; it does not establish behavior beyond it.

Main entry points: [`src/struct_in_file.c`](https://github.com/gnelshahnazaryan/file_system_c/blob/main/src/struct_in_file.c) (Menu CLI), [`store/struct.bin`](https://github.com/gnelshahnazaryan/file_system_c/blob/main/store/struct.bin) (Binary records), [`src/functions.c`](https://github.com/gnelshahnazaryan/file_system_c/blob/main/src/functions.c) (Export text), [`store/Persons.txt`](https://github.com/gnelshahnazaryan/file_system_c/blob/main/store/Persons.txt) (Text records)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["CLI"]
  node_cli["Menu CLI<br/>[struct_in_file.c]"]
  node_menu["Menu display<br/>[functions.c]"]
end

subgraph group_operations["Record operations"]
  node_add["Add records<br/>[functions.c]"]
  node_print_one["Print one<br/>[functions.c]"]
  node_search["Search name<br/>[functions.c]"]
  node_update["Update record<br/>[functions.c]"]
  node_remove["Remove record<br/>[functions.c]"]
  node_count["Count records<br/>[functions.c]"]
  node_reset["Reset store<br/>[functions.c]"]
  node_print_all["Print all<br/>[functions.c]"]
  node_export["Export text<br/>[functions.c]"]
end

subgraph group_storage["File storage"]
  node_binary[("Binary records<br/>[struct.bin]")]
  node_text["Text records<br/>[Persons.txt]"]
end

node_user(("User"))

node_user -->|"chooses operation"| node_cli
node_cli -->|"prompts and prints"| node_user
node_cli -->|"displays menu"| node_menu
node_cli -->|"dispatches add"| node_add
node_cli -->|"dispatches lookup"| node_print_one
node_cli -->|"dispatches search"| node_search
node_cli -->|"dispatches update"| node_update
node_cli -->|"dispatches removal"| node_remove
node_cli -->|"dispatches count"| node_count
node_cli -->|"dispatches reset"| node_reset
node_cli -->|"dispatches listing"| node_print_all
node_cli -->|"dispatches export"| node_export
node_add -->|"appends records"| node_binary
node_print_one -->|"reads record"| node_binary
node_print_one -->|"checks record count"| node_count
node_search -->|"reads records"| node_binary
node_update -->|"reads and updates"| node_binary
node_remove -->|"rewrites records"| node_binary
node_count -->|"counts records"| node_binary
node_reset -->|"truncates file"| node_binary
node_print_all -->|"reads records"| node_binary
node_export -->|"reads records"| node_binary
node_export -->|"gets record count"| node_count
node_export -->|"writes records"| node_text

click node_cli "https://github.com/gnelshahnazaryan/file_system_c/blob/main/src/struct_in_file.c"
click node_menu "https://github.com/gnelshahnazaryan/file_system_c/blob/main/src/functions.c"
click node_add "https://github.com/gnelshahnazaryan/file_system_c/blob/main/src/functions.c"
click node_print_one "https://github.com/gnelshahnazaryan/file_system_c/blob/main/src/functions.c"
click node_search "https://github.com/gnelshahnazaryan/file_system_c/blob/main/src/functions.c"
click node_update "https://github.com/gnelshahnazaryan/file_system_c/blob/main/src/functions.c"
click node_remove "https://github.com/gnelshahnazaryan/file_system_c/blob/main/src/functions.c"
click node_count "https://github.com/gnelshahnazaryan/file_system_c/blob/main/src/functions.c"
click node_reset "https://github.com/gnelshahnazaryan/file_system_c/blob/main/src/functions.c"
click node_print_all "https://github.com/gnelshahnazaryan/file_system_c/blob/main/src/functions.c"
click node_export "https://github.com/gnelshahnazaryan/file_system_c/blob/main/src/functions.c"
click node_binary "https://github.com/gnelshahnazaryan/file_system_c/blob/main/store/struct.bin"
click node_text "https://github.com/gnelshahnazaryan/file_system_c/blob/main/store/Persons.txt"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_cli,node_menu,node_user toneBlue
class node_add,node_print_one,node_search,node_update,node_remove,node_count,node_reset,node_print_all,node_export toneAmber
class node_binary,node_text toneMint
```

## Components

### CLI

- [Menu CLI](https://github.com/gnelshahnazaryan/file_system_c/blob/main/src/struct_in_file.c): `src/struct_in_file.c`
- [Menu display](https://github.com/gnelshahnazaryan/file_system_c/blob/main/src/functions.c): `src/functions.c`

### Record operations

- [Add records](https://github.com/gnelshahnazaryan/file_system_c/blob/main/src/functions.c): `src/functions.c`
- [Print one](https://github.com/gnelshahnazaryan/file_system_c/blob/main/src/functions.c): `src/functions.c`
- [Search name](https://github.com/gnelshahnazaryan/file_system_c/blob/main/src/functions.c): `src/functions.c`
- [Update record](https://github.com/gnelshahnazaryan/file_system_c/blob/main/src/functions.c): `src/functions.c`
- [Remove record](https://github.com/gnelshahnazaryan/file_system_c/blob/main/src/functions.c): `src/functions.c`
- [Count records](https://github.com/gnelshahnazaryan/file_system_c/blob/main/src/functions.c): `src/functions.c`
- [Reset store](https://github.com/gnelshahnazaryan/file_system_c/blob/main/src/functions.c): `src/functions.c`
- [Print all](https://github.com/gnelshahnazaryan/file_system_c/blob/main/src/functions.c): `src/functions.c`
- [Export text](https://github.com/gnelshahnazaryan/file_system_c/blob/main/src/functions.c): `src/functions.c`

### File storage

- [Binary records](https://github.com/gnelshahnazaryan/file_system_c/blob/main/store/struct.bin): `store/struct.bin`
- [Text records](https://github.com/gnelshahnazaryan/file_system_c/blob/main/store/Persons.txt): `store/Persons.txt`

### Other components

- **User**

## Connections

- User → Menu CLI: chooses operation
- Menu CLI → User: prompts and prints
- Menu CLI → Menu display: displays menu
- Menu CLI → Add records: dispatches add
- Menu CLI → Print one: dispatches lookup
- Menu CLI → Search name: dispatches search
- Menu CLI → Update record: dispatches update
- Menu CLI → Remove record: dispatches removal
- Menu CLI → Count records: dispatches count
- Menu CLI → Reset store: dispatches reset
- Menu CLI → Print all: dispatches listing
- Menu CLI → Export text: dispatches export
- Add records → Binary records: appends records
- Print one → Binary records: reads record
- Print one → Count records: checks record count
- Search name → Binary records: reads records
- Update record → Binary records: reads and updates
- Remove record → Binary records: rewrites records
- Count records → Binary records: counts records
- Reset store → Binary records: truncates file
- Print all → Binary records: reads records
- Export text → Binary records: reads records
- Export text → Count records: gets record count
- Export text → Text records: writes records
