https://github.com/wojberni/file-browser
Terminal UI browser for files written in Zig.
https://github.com/wojberni/file-browser
file-browser file-browsing file-tree learning tree-structure tui-app zig zig-lang
Last synced: 12 months ago
JSON representation
Terminal UI browser for files written in Zig.
- Host: GitHub
- URL: https://github.com/wojberni/file-browser
- Owner: Wojberni
- Created: 2024-07-12T16:19:37.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-04-02T19:48:22.000Z (about 1 year ago)
- Last Synced: 2025-07-02T07:07:13.497Z (12 months ago)
- Topics: file-browser, file-browsing, file-tree, learning, tree-structure, tui-app, zig, zig-lang
- Language: Zig
- Homepage:
- Size: 875 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# File-browser
File-browser is a project for educational purposes written in Zig.
I was trying to remind myself, how trees work and file structure was a natural choice.
> Code was tested on Linux, it is NOT Windows compatible.
> TUI was developed using Kitty, due to [libvaxis](https://github.com/rockorager/libvaxis) compatibility. Some functionalities might not work as they should on other terminals.
## Basic commands
Build gui, demo or tests for file-browser using following commands.
```
zig build gui
```

```
zig build demo
```

```
zig build test
```
## Project structure
* build.zig, build.zig.zon - zig build system config
* src/ - file-browser module, all core file tree functionalities
* gui/ - gui using file-browser module and [libvaxis](https://github.com/rockorager/libvaxis)
* tests/ - tests for file-browser module
* examples/ - demo of all functions for file-browser module
```
file-browser
│ README.md
│ build.zig
│ build.zig.zon
└───src
│ │ main.zig
│ │ ...
└───gui
│ │ main.zig
│ │ ...
└───tests
│ │ tests.zig
│ │ ...
└───examples
│ │ demo.zig
│ │ ...
```
## Basic flow and functionality
* tree init/deinit - file tree struct, root node from selected directory
* tree loading - loading files and directories as nodes to initialized tree structure
* tree traversal - traverse loaded tree, basically `tree` command functionality
* find node - find node and return path to it based on given name
* insert node - insert node to given path (creates files on disk as well!)
* delete node - deletes node of given path (deletes files on disk as well!)