Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 9 days 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 (7 months ago)
- Default Branch: main
- Last Pushed: 2024-10-16T17:35:08.000Z (4 months ago)
- Last Synced: 2024-10-18T14:37:24.827Z (4 months ago)
- Topics: file-browser, file-browsing, file-tree, learning, tree-structure, tui-app, zig, zig-lang
- Language: Zig
- Homepage:
- Size: 869 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
```![Gui](gui.gif)
```
zig build demo
```
![Demo](demo.gif)```
zig build tests
```## 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!)