A tiny (18KB for rpi zero)easy to read file listing tool. rust no_std and Libc

yulkor2 pts0 comments

GitHub - tracyspacy/fli: cli tool to list directory content · GitHub

/" data-turbo-transient="true" />

Skip to content

Search or jump to...

Search code, repositories, users, issues, pull requests...

-->

Search

Clear

Search syntax tips

Provide feedback

--><br>We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Cancel

Submit feedback

Saved searches

Use saved searches to filter your results more quickly

-->

Name

Query

To see all available qualifiers, see our documentation.

Cancel

Create saved search

Sign in

/;ref_cta:Sign up;ref_loc:header logged out"}"<br>Sign up

Appearance settings

Resetting focus

You signed in with another tab or window. Reload to refresh your session.<br>You signed out in another tab or window. Reload to refresh your session.<br>You switched accounts on another tab or window. Reload to refresh your session.

Dismiss alert

{{ message }}

tracyspacy

fli

Public

Notifications<br>You must be signed in to change notification settings

Fork

Star<br>11

main

BranchesTags

Go to file

CodeOpen more actions menu

Folders and files<br>NameNameLast commit message<br>Last commit date<br>Latest commit

History<br>58 Commits<br>58 Commits

.cargo

.cargo

src

src

.gitattributes

.gitattributes

.gitignore

.gitignore

Cargo.lock

Cargo.lock

Cargo.toml

Cargo.toml

LICENSE

LICENSE

README.md

README.md

View all files

Repository files navigation

fli

fli is a cli tool to list directory content

Why

I have access to my raspberry pi zero via ssh only. As for me it is hard to differentiate types of files etc based on colors, I needed something more readable and clear like picture/icon or emoji as I ended up with etc. And I decided to build fli and since ls is obviosly preinstalled on almost any machine, the second requirement for fli as a complimentary tool, is to be tiny.

Thus fli is a tiny (18KB), easy to read file listing tool.

While working on fli, another aspect of my interest and motivation is to check if with Rust one can build coreutils-like tools, but faster and smaller.

Readability : Nice readability thanks to use of emojis (📄 and 🗂️) instead of text coloring.

Speed : By default directory entries are streamed directly from readdir() to stdout without heap allocation.

Size: Since rust std contributes heavily to binary size, this project is no_std + libc (it contains unsafe code blocks ).

Binary size:

M series mac: 51 KB ,

rpi zero w : 18 KB .

Current display options:

fli : short (name and type) not sorted output - direct stream, no heap allocation

fli -s: short (name and type) sorted by name output - uses heap allocation

fli -l : long (name, type, metadata ) not sorted output and fixed-sized alignment (20 chars for size and n_link) - direct stream, no heap allocation

fli -l -s: long (name, type, metadata ) sorted by name output and dynamic alignment - uses heap allocation.

fli -l -S: long (name, type, metadata ) sorted by size output and dynamic alignment - uses heap allocation.

New display options may be added soon.

Build

Build: cargo build --release

Build with cross for raspberry pi zero w: cross build --release --target arm-unknown-linux-gnueabihf

Copy to rpi : scp /target/arm-unknown-linux-gnueabihf/release/fli @.local:

View

Sorted by name Long output:

Sorted by size Long output:

Symlink with path

Benchmarks

About

cli tool to list directory content

Topics

rust

files

terminal

tools

command-line

libc

ls

rust-no-std

Resources

Readme

License

MIT license

Uh oh!

There was an error while loading. Please reload this page.

Activity

Stars

11<br>stars

Watchers

watching

Forks

fork

Report repository

Releases

tags

Packages

Uh oh!

There was an error while loading. Please reload this page.

Contributors

Uh oh!

There was an error while loading. Please reload this page.

Languages

Rust<br>100.0%

You can’t perform that action at this time.

name cargo build sorted output tool

Related Articles