Code Monkey home page Code Monkey logo

nat's Introduction

dependency status natls

🎨 Natls 🎨

example

Why Natls?

  • Showing file permissions
  • Showing file size
  • Showing the date that the file was modified last
  • Showing the user that the file belongs to
  • Showing the group that the file belongs to
  • An easy to use file search
  • A splash of color to distinguish between files and folders and other file types

Installation

# Through Cargo
cargo install natls

# Through Homebrew
brew install willdoescode/natls/natls

# Through SnapCraft
sudo snap install natls

Usage

natls <flags> <dir>

Understanding permissions output

000 no access
100 read
010 write
001 execute
101 read and execute
110 read and write
011 write and execute
111 read write and execute

Format: user-group-other

User: Read, Write, and Execute

rwxrw----

All Groups: Read, Write, and Execute

rwxrwxrwx

⚠️ Natls is currently not supported on Windows

nat's People

Contributors

0xflotus avatar codelongandprosper90 avatar das-g avatar denysvitali avatar figsoda avatar patrickwilmes avatar quackduck avatar sebastianschildt avatar sley3 avatar sohamb117 avatar spikecodes avatar tbille avatar tf-maam avatar willdoescode avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nat's Issues

Rework the permission output

The permission output is confusing to say the least.
Maybe the reason is that you did not understand the permission system yet, so I'll explain and maybe you can use this information to improve your program.

The permissions are stored as a 9 or 12 bit value organized as follows:

  1. 3 bits (read, write, executable) for user, group, others
  2. 3 bits for setuid, setgid, sticky bit (if available)

Each bit can be set individually making up the permissions.

Now you can represent numbers in decimal form (the usual human system, because we have ten fingers to count with).
But this is not good when talking about bits, because they live in the binary system.

So the permissions rw-rw-r-- would translate to

000110110100

Because this is long and hard to read, you can group the individual sections and represent them as octal numbers.

000 = 0
110 = 6
100 = 4

So the above example would read 0664.

So you are required to display the permissions exactly as you read them out with stat().

If you get 0755 (octal) from stat() you have to display it as rwxr-xr-x - at least of you wish to use the rwx notation. You can invent another notation if you wish, but that must exactly represent the permissions nevertheless.

Another note: you are appending the @ symbol to each of your permission outputs. But the @ symbol is not a matter of style or to look cool - it actually has a meaning. The presence of the @ symbol says that there are extended attributes on that file.

Headline does not adjust when some outputs are turned off

For example:

nat -l -u -p
permissions size last modified user name
  4.1 kB Oct 22 20:20:58 micah Pictures/
  4.1 kB Oct 24 01:57:42 micah Documents/
  4.1 kB Oct 14 16:10:40 micah snap/
  4.1 kB Oct 23 19:07:30 micah Downloads/
  4.1 kB Oct 25 17:03:17 micah Desktop/
  4.1 kB Aug  8 19:25:20 micah Videos/
  4.1 kB Aug  8 19:25:20 micah Templates/
  4.1 kB Aug  8 19:25:20 micah Public/
  4.1 kB Aug  8 19:25:20 micah Music/
  4.1 kB Sep 16 17:54:05 micah tmp/

The headline still has the titles for permissions and user even though they are turned off.

ubuntu 20.10 compiler warnings and 'nat -l' panic

Built and ran it like supposed in issue #16 on Ubuntu 20.10.

On compiling i got some warnings:

warning: value assigned to `groups_size` is never read
  --> src/main.rs:69:11
   |
69 |   let mut groups_size: i32 = 0;
   |           ^^^^^^^^^^^
   |
   = note: `#[warn(unused_assignments)]` on by default
   = help: maybe it is overwritten before being read?

warning: variable `user_size` is assigned to, but never used
  --> src/main.rs:76:11
   |
76 |   let mut user_size: i32 = 0;
   |           ^^^^^^^^^
   |
   = note: `#[warn(unused_variables)]` on by default
   = note: consider using `_user_size` instead

warning: value assigned to `user_size` is never read
  --> src/main.rs:78:5
   |
78 |     user_size = 0;
   |     ^^^^^^^^^
   |
   = help: maybe it is overwritten before being read?

warning: value assigned to `user_size` is never read
  --> src/main.rs:80:5
   |
80 |     user_size = get_user_by_uid(get_current_uid()).unwrap().name().to_str().unwrap().len() as i32 - 4;
   |     ^^^^^^^^^
   |
   = help: maybe it is overwritten before being read?

warning: unused variable: `mode_count`
   --> src/main.rs:118:9
    |
118 |     let mode_count = perms(mode as u16).len();
    |         ^^^^^^^^^^ help: consider prefixing with an underscore: `_mode_count`

warning: unused variable: `mode_count`
  --> src/single.rs:14:11
   |
14 |   let mut mode_count = 0;
   |           ^^^^^^^^^^ help: consider prefixing with an underscore: `_mode_count`

warning: variable does not need to be mutable
  --> src/single.rs:14:7
   |
14 |   let mut mode_count = 0;
   |       ----^^^^^^^^^^
   |       |
   |       help: remove this `mut`
   |
   = note: `#[warn(unused_mut)]` on by default

    Finished dev [unoptimized + debuginfo] target(s) in 1m 02s

On testing ./nat -l thread 'main' panicked with:

thread 'main' panicked at 'attempt to subtract with overflow', src/main.rs:70:6
note: run with 'RUST_BACKTRACE=1' environment variable to display a backtrace
permissions size last modified

nat is no longer in the arch user repository

I've received this email on 10/27/2020, 10:46 PM UTC:

Foxboron [1] deleted nat-git [2].

You will no longer receive notifications about this package.

[1] https://aur.archlinux.org/account/Foxboron/
[2] https://aur.archlinux.org/pkgbase/nat-git/

I don't know the reason for this but I think the installation instructions for arch can be removed for now until another maintainer chooses to support this program.

Run rustfmt

Create your rustfmt.toml config file and run cargo fmt with it so contributing to this project would be easier.

Snap release updates

The issue

The current release on snap does not match the actual version.

Reproduce

  • install via "sudo snap install natls"
  • check version of nat with "natls --version"

Things I tried

  • update nat with "sudo snap refresh natls"

Idea for a fix

Snap should be integrated into a CI like GitHub Actions, Jenkins or similar to automatically update the binary. Or on each release someone should update the binary manually.

thread 'main' panicked at 'called `Option::unwrap()`

System Information:

  • macOS Big Sur 11.1

  • MacBook Pro (15-inch, 2018)

  • nat version 2.1.10 (installed via Homebrew)

Sequence of commands:

export RUST_BACKTRACE=full To give full details about the crash

natls
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', src/utils/get_group.rs:6:8
stack backtrace:
   0:        0x10092860e - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h3b6ed74a60c4de30
   1:        0x1009576ae - core::fmt::write::h72dd6ddbc116ef3c
   2:        0x100927d1a - std::io::Write::write_fmt::h033803ce14d847cc
   3:        0x10093bb99 - std::panicking::default_hook::{{closure}}::h040276b51a1a4749
   4:        0x10093b8be - std::panicking::default_hook::h2a43ed83163cecb9
   5:        0x10093c12a - std::panicking::rust_panic_with_hook::h15f3dba6c099e04e
   6:        0x100928c99 - std::panicking::begin_panic_handler::{{closure}}::h33fb39231ad9a88d
   7:        0x100928788 - std::sys_common::backtrace::__rust_end_short_backtrace::hd5ec6f84e4df1d34
   8:        0x10093bca3 - _rust_begin_unwind
   9:        0x10095c9cf - core::panicking::panic_fmt::h7889f3b8e7c118f7
  10:        0x10095c927 - core::panicking::panic::h467f1ca176190211
  11:        0x1008be832 - natls::utils::get_group::group::hd7e992d1d04d532e
  12:        0x1008b9ee1 - natls::File::new::h1bc60eb99da8151d
  13:        0x1008c4ade - <core::iter::adapters::ResultShunt<I,E> as core::iter::traits::iterator::Iterator>::next::h724542ea187dcaf1
  14:        0x1008c15be - <alloc::vec::Vec<T> as alloc::vec::SpecFromIter<T,I>>::from_iter::hc2fbc564bc446f30
  15:        0x1008c4f42 - core::iter::adapters::process_results::h67eaf86eb83e6497
  16:        0x1008bb201 - natls::main::h7b891e1e5baa18b7
  17:        0x1008bcada - std::sys_common::backtrace::__rust_begin_short_backtrace::ha85bf5dbd5f6fb8d
  18:        0x1008bcafc - std::rt::lang_start::{{closure}}::he35549e67e86e1ef
  19:        0x10093f22e - std::rt::lang_start_internal::h1881ffd15d3416e4
  20:        0x1008bcaa9 - _main

ℹ️ The other nat commands work just fine. The issue happens only with the regular execution, without any parameters.

symlink directories are sorted with dirs, but appear as files

Here is ls output vs natls output.


$ ls -lh --group-directories-first
total 166M
drwxr-xr-x  5 davised davised 4.0K Oct 23 14:28 datasets
drwxr-xr-x  8 davised davised 4.0K Jul 22 22:05 FastQC
lrwxrwxrwx  1 davised davised   22 Sep  2 14:52 firefox-nightly -> firefox-nightly-82.0a1
drwxr-xr-x 10 davised davised 4.0K Oct 28 10:47 firefox-nightly-82.0a1
lrwxrwxrwx  1 davised davised   18 Sep 16 12:35 iqtree -> iqtree-2.1.1-Linux
drwxr-xr-x  3 davised davised 4.0K Oct 23 15:03 iqtree-1.6.12-Linux
drwxr-xr-x  3 davised davised 4.0K Jul 17 11:25 iqtree-2.0.6-Linux
drwxr-xr-x  3 davised davised 4.0K Sep 16 13:48 iqtree-2.1.1-Linux
drwxr-xr-x  5 davised davised 4.0K Sep 28 14:47 mafft
drwxr-xr-x  6 davised davised 4.0K Oct 28 11:44 nat
drwxr-xr-x  3 davised davised 4.0K Oct 23 12:28 ncbi_dataset
drwxr-xr-x  3 davised davised 4.0K Oct 23 06:18 ncbi-datasets-pylib-10.1.3
drwxr-xr-x  4 davised davised 4.0K Oct 21 22:32 seqIO_extract
-rw-r--r--  1 davised davised    3 Oct 22 16:05 actinobacteria.json
-rw-r--r--  1 davised davised  62M Oct 23 10:13 actinobacteria.jsonl
-rw-r--r--  1 davised davised    3 Oct 22 15:48 data.json
-rwxr-xr-x  1 davised davised  11M Oct 22 15:35 datasets-10.1.2
-rw-r--r--  1 davised davised 9.8M Jan 15  2020 fastqc_v0.11.9.zip
-rw-r--r--  1 davised davised  72M Sep  2 14:48 firefox-82.0a1.en-US.linux-x86_64.tar.bz2
-rw-r--r--  1 davised davised 3.5M Aug 14  2019 iqtree-1.6.12-Linux.tar.gz
-rw-r--r--  1 davised davised 4.4M Jun 11 19:26 iqtree-2.0.6-Linux.tar.gz
-rw-r--r--  1 davised davised 4.5M Aug 21 15:44 iqtree-2.1.1-Linux.tar.gz
-rw-r--r--  1 davised davised  89K Oct 23 06:31 ncbi-datasets-pylib-10.1.3.tar.gz
-rw-r--r--  1 davised davised 2.1K Oct 23 13:21 ncbi_dataset.zip
-rw-------  1 davised davised  661 Oct 23 15:27 README.md
-rw-r--r--  1 davised davised    0 Oct 28 11:44 rust.sh
$ natls
rwxrwxrwx     22 B Sep  2 21:52:36 davised davised firefox-nightly
rwxr-xr-x   4.1 kB Oct 23 13:18:45 davised davised ncbi-datasets-pylib-10.1.3/
rwxrwxrwx     18 B Sep 16 19:35:03 davised davised iqtree
rwxr-xr-x   4.1 kB Jul 17 18:25:47 davised davised iqtree-2.0.6-Linux/
rwxr-xr-x   4.1 kB Oct 23 21:28:34 davised davised datasets/
rwxr-xr-x   4.1 kB Sep 16 20:48:37 davised davised iqtree-2.1.1-Linux/
rwxr-xr-x   4.1 kB Oct 28 17:47:09 davised davised firefox-nightly-82.0a1/
rwxr-xr-x   4.1 kB Jul 23 05:05:30 davised davised FastQC/
rwxr-xr-x   4.1 kB Oct 23 22:03:56 davised davised iqtree-1.6.12-Linux/
rwxr-xr-x   4.1 kB Oct 22 05:32:13 davised davised seqIO_extract/
rwxr-xr-x   4.1 kB Oct 28 18:44:40 davised davised nat/
rwxr-xr-x   4.1 kB Sep 28 21:47:49 davised davised mafft/
rwxr-xr-x   4.1 kB Oct 23 19:28:48 davised davised ncbi_dataset/
rwxr-xr-x 11.46 MB Oct 22 22:35:25 davised davised datasets-10.1.2
rw-r--r--      0 B Oct 28 18:44:35 davised davised rust.sh
rw-r--r--      3 B Oct 22 23:05:29 davised davised actinobacteria.json
rw-r--r--      3 B Oct 22 22:48:09 davised davised data.json
rw-------    661 B Oct 23 22:27:10 davised davised README.md
rw-r--r--  3.61 MB Aug 15 06:40:05 davised davised iqtree-1.6.12-Linux.tar.gz
rw-r--r-- 64.16 MB Oct 23 17:13:49 davised davised actinobacteria.jsonl
rw-r--r-- 10.25 MB Jan 15 19:39:42 davised davised fastqc_v0.11.9.zip
rw-r--r--   2.1 kB Oct 23 20:21:12 davised davised ncbi_dataset.zip
rw-r--r--  90.8 kB Oct 23 13:31:14 davised davised ncbi-datasets-pylib-10.1.3.tar.gz
rw-r--r--  4.57 MB Jun 12 02:26:59 davised davised iqtree-2.0.6-Linux.tar.gz
rw-r--r--  4.66 MB Aug 21 22:44:07 davised davised iqtree-2.1.1-Linux.tar.gz
rw-r--r-- 74.91 MB Sep  2 21:48:26 davised davised firefox-82.0a1.en-US.linux-x86_64.tar.bz2

Either color-coding the links and/or showing the dir link destination would be nice. You could also add the dir flag with the rwx flags like ls does. I'd also suggest sorting DIR by name by default, if possible.

Really excited about this project. Are you looking for pull requests? I'm not very experienced with cargo, but hey everyone has to start somewhere.

Printing infinite underscores

When executing nat it prints the header correctly but get's stuck printing an infinite amount of underscore characters (Actually not the ASCII underscore character '_' but the space character with some terminal drawing shenenigans). Has to be killed with ^C

My guess would be that the function call draw_headline("group",get_group_by_gid(get_current_gid()).unwrap().name().to_str().unwrap().len() - 5, true); calls draw_headline with a negative line_length so the for-loop runs indefinitely? Not sure though, I haven't looked too closely at the source code.

2020-10-24T22:10:59_pngquant

OS: Arch Linux
Tested terminal emulators: termite and tmux
I tried both: The provided binary as well as building nat-git from the AUR via yay -S nat-git

Comparison with Exa

Hi there,

First of all thanks for this project, it seems to have a lot of nice features compared to the basic ls :)

One thing I think could be great is to show a comparison with Exa, which is another ls replacement that existed for a long time (more than 5 years).

This way, potentiel users could see what benefits Nat delivers compared to Exa.

What do you think?

Date and time are zeros

See below:

# davised @ vader in ~/.local/downloads [22:58:17]
$ natls --version
natls 2.1.8

# davised @ vader in ~/.local/downloads [22:56:28]
$ natls -lg
drwxr-xr-x     4 KB davised davised 00 000 00:00:00 cutadapt-3.1/
drwxr-xr-x     4 KB davised davised 00 000 00:00:00 ncbi-datasets-pylib-10.1.3/
drwxr-xr-x     4 KB davised davised 00 000 00:00:00 iqtree-2.0.6-Linux/
drwxr-xr-x     4 KB davised davised 00 000 00:00:00 iqtree-2.1.1-Linux/
...

TimeZone

How to set the time zone? There is a time difference between the display time and the real time

Exec format error

I downloaded nat v1.0.7, sudo mv it to /usr/local/bin, chmod +x /usr/local/bin/nat and run nat

$ nat
bash: /usr/local/bin/nat: cannot execute binary file: Exec format error

I am on Ubuntu 20

Feature request: widescreen layout

For directories with ~100 of files the table layout becomes tricky and requires the user to manually scroll the screen.
'ls' by default uses the window space by adding as many columns as possible and offers more overview that way.
After all, a widescreen is probably the default setup.
Making use of the available window space would increase usability of nat as well.
Maybe it's an option to show two tables next to each other if the space is sufficient.
Not sure if dynamic layouts are possible that way.

Btw: "nat | more" produces output hickups by adding empty lines.

Differences of unsigend numbers

There are some calculations with unsigned integers that may lead to unintended behavior.
E.g., try with a group name with less than 5 characters.

draw_headline("group",get_group_by_gid(get_current_gid()).unwrap().name().to_str().unwrap().len() - 5, true);

Searching for nonexistent file or directory returns Rust error

OS: macOS 11.1
shell: zsh
Terminal: Default
Application source: Homebrew
Cargo version: 1.49.0

Running natls nonexistent_file returns the following error:

thread 'main' panicked at 'called Result::unwrap() on an Err value: Os { code: 2, kind: NotFound, message: "No such file or directory" }', src/utils/get_group.rs:5:53

thread 'main' panicked at 'attempt to subtract with overflow', src/main.rs:76:15

My Ubuntu rust packages are probably quite old. But I don't think it matters too much.

tilmanb@zuse:~/git/nat$ RUST_BACKTRACE=1 cargo run
    Finished dev [unoptimized + debuginfo] target(s) in 0.07s
     Running `target/debug/nat`
thread 'main' panicked at 'attempt to subtract with overflow', src/main.rs:76:15
stack backtrace:
   0: backtrace::backtrace::libunwind::trace
             at /usr/src/rustc-1.43.0/vendor/backtrace/src/backtrace/libunwind.rs:86
   1: backtrace::backtrace::trace_unsynchronized
             at /usr/src/rustc-1.43.0/vendor/backtrace/src/backtrace/mod.rs:66
   2: std::sys_common::backtrace::_print_fmt
             at src/libstd/sys_common/backtrace.rs:78
   3: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
             at src/libstd/sys_common/backtrace.rs:59
   4: core::fmt::write
             at src/libcore/fmt/mod.rs:1063
   5: std::io::Write::write_fmt
             at src/libstd/io/mod.rs:1426
   6: std::sys_common::backtrace::_print
             at src/libstd/sys_common/backtrace.rs:62
   7: std::sys_common::backtrace::print
             at src/libstd/sys_common/backtrace.rs:49
   8: std::panicking::default_hook::{{closure}}
             at src/libstd/panicking.rs:204
   9: std::panicking::default_hook
             at src/libstd/panicking.rs:224
  10: std::panicking::rust_panic_with_hook
             at src/libstd/panicking.rs:470
  11: rust_begin_unwind
             at src/libstd/panicking.rs:378
  12: core::panicking::panic_fmt
             at src/libcore/panicking.rs:85
  13: core::panicking::panic
             at src/libcore/panicking.rs:52
  14: nat::main
             at src/main.rs:76
  15: std::rt::lang_start::{{closure}}
             at /usr/src/rustc-1.43.0/src/libstd/rt.rs:67
  16: std::rt::lang_start_internal::{{closure}}
             at src/libstd/rt.rs:52
  17: std::panicking::try::do_call
             at src/libstd/panicking.rs:303
  18: __rust_maybe_catch_panic
             at src/libpanic_unwind/lib.rs:86
  19: std::panicking::try
             at src/libstd/panicking.rs:281
  20: std::panic::catch_unwind
             at src/libstd/panic.rs:394
  21: std::rt::lang_start_internal
             at src/libstd/rt.rs:51
  22: std::rt::lang_start
             at /usr/src/rustc-1.43.0/src/libstd/rt.rs:67
  23: main
  24: __libc_start_main
  25: _start
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
permissions   size      last modified       grouptilmanb@zuse:~/git/nat$
tilmanb@zuse:~/git/nat$ git log -n 1
commit 6d34b3c80b77f94e2f076158affcb8e6ba8d9b04 (HEAD -> main, origin/main, origin/HEAD)
Author: Will Lane <[email protected]>
Date:   Fri Oct 23 00:29:00 2020 -0700

    updated colors for users using lighter terminal themes
tilmanb@zuse:~/git/nat$ rustc --version
rustc 1.43.0

My rust foo is very weak and I didn't have tome to dig into it. But perhaps you want to know.

Feel free to just close the ticket.

Can not list root directory /

It can not list fs root "/"

$ nat /
Error: Os { code: 2, kind: NotFound, message: "No such file or directory" }

but

$ ls /
Applications	Library		Users		bin		dev		home		private		tmp		var
EFI-Backups	System		Volumes		cores		etc		opt		sbin		usr

This is on OS X 10.15

Fix installation section in README

The installation section in the README looks like a code block but it should be written in plain text font. Also you should provide command on how to copy the file to /usr/local/bin

Add unicode symbols for different file types

You can add some Unicode symbols to each type of item. For example, an icon for a plain text file, a different one for a folder, something else for a symlink. You could also provide a command line flag to turn it off just in case someone uses a font that doesn't support symbols and weird boxes appear in place of the symbols

Does not work with watch

This is an unusual use case, but sometimes I want to see large files being copied and their size growing.

I'd love to use watch natls for those times.

Cargo build fails with "error[E0308]: mismatched types" Error

Issue description

I'm trying to build nat with my Debian 10 installation. It fails with a "error[E0308]: mismatched types" error.

Steps to reproduce the issue

  1. git clone https://github.com/willdoescode/nat.git
  2. cd ./nat
  3. cargo build --release

What's the expected result?

  • The build should work.

What's the actual result?

  • The build does not work and fails with the following error Message:
Compiling nat v1.0.9 (/home/[USERNAME]/Workspace/git/nat)
     Running `rustc --crate-name nat --edition=2018 src/main.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C opt-level=3 -C metadata=adba114910da65c6 -C extra-filename=-adba114910da65c6 --out-dir /home/[USERNAME]/Workspace/git/nat/target/release/deps -L dependency=/home/[USERNAME]/Workspace/git/nat/target/release/deps --extern ansi_term=/home/[USERNAME]/Workspace/git/nat/target/release/deps/libansi_term-eadfc56f31755089.rlib --extern chrono=/home/[USERNAME]/Workspace/git/nat/target/release/deps/libchrono-e6ab3cac18a449c9.rlib --extern libc=/home/[USERNAME]/Workspace/git/nat/target/release/deps/liblibc-bec547172235da48.rlib --extern pretty_bytes=/home/[USERNAME]/Workspace/git/nat/target/release/deps/libpretty_bytes-9706fdfae34e91af.rlib --extern structopt=/home/[USERNAME]/Workspace/git/nat/target/release/deps/libstructopt-95351602fc045da0.rlib --extern termion=/home/[USERNAME]/Workspace/git/nat/target/release/deps/libtermion-ba47c272930f5c21.rlib --extern users=/home/[USERNAME]/Workspace/git/nat/target/release/deps/libusers-640153e22e8cf3ab.rlib`
error[E0308]: mismatched types
   --> src/main.rs:207:27
    |
207 |     let user = triplet(mode, S_IRUSR, S_IWUSR, S_IXUSR);
    |                              ^^^^^^^ expected `u16`, found `u32`
    |
help: you can convert an `u32` to `u16` and panic if the converted value wouldn't fit
    |
207 |     let user = triplet(mode, S_IRUSR.try_into().unwrap(), S_IWUSR, S_IXUSR);
    |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^

Here's the complete build log:

cargo build --verbose --release > out.txt 2>&1

out.txt

Additional details

Some System Info that may or may not help:

$ cargo --version
cargo 1.42.1

$ lsb_release -a
No LSB modules are available.
Distributor ID:	Debian
Description:	Debian GNU/Linux 10 (buster)
Release:	10
Codename:	buster

$ uname -a
Linux [HOSTNAME] 5.8.0-0.bpo.2-amd64 #1 SMP Debian 5.8.10-1~bpo10+1 (2020-09-26) x86_64 GNU/Linux

Distribute as a package

It would be great to be able to install via flatpak, snap and for example apt install command.

Windows 10

Ok Windows 10 is the most used OS. I bet you will get more stars once you add it.

Error: Os { code: 13, kind: PermissionDenied, message: "Permission denied" }

First of all thanks for such a good tool, I try to install this tool on ubuntu20:

apt-get install rustc cargo
cargo install natls

But when I try to execute it, it says I don't have permission.

$ ~/.cargo/bin/natls
Error: Os {code: 13, kind: PermissionDenied, message: "Permission denied"}

When I enter the ~/.cargo/bin/ directory, the execution will succeed

$ natls
rwxrwxr-x 8.16 MB Oct 27 06:05:12 yanqing yanqing natls

Thanks for any reply

"nat" just prints endless underscores

I checked out the code and built it with "cargo build --release".

Started the binary and it prints underscores forever.

The "Help" function (-h) works fine.

OS: Arch Linux 64bit

Feature request: parameters for sorting

It would be nice to have parameters for influencing the order in which the directory content is displayed.
Name, size, and last-modified would be cool options. Not the mention 'directories before files'. ;)

Endless loop printing whitespaces

When listing some folders, natls starts by printing the folder contents but then goes on to print infinite whitespaces.
image
I'm not quite sure what causes this but it is always the same folders (i.e. if one folder does it once, it will do it every time).

The example above comes from the examples/basic folder of this project.

I'm on macOS Big Sur, iTerm, zsh 5.8 (x86_64-apple-darwin20.0.0), rustc 1.47.0-nightly (6c8927b0c 2020-07-26), natls 1.2.11

V2.1.9 is not pushed to GitHub

Version 2.1.9 is not released to GitHub. this affected a non working Homebrew installation.
Homebrew tries to install 2.1.9 which is not released yet.

Won't run on Ubuntu 20.10 amd64

Gives the following error message:

bash: /usr/local/bin/nat: Kann die Binärdatei nicht ausführen: Fehler im Format der Programmdatei

(sorry for german error message, means somthing like: cannot execute binary file: error in format).

I guess, some dependencies are missing that are not mentioned in the readme?

panic if uid/gid names does not exist on local system

If you list a (network-)directory containing files with uids/gids that do not exist on the local system nat panics.

In this case get_user_by_uid/get_group_by_gid do return a None, but this is not checked - just unwrapped

Alphabetical

Nice little tool!

I was wondering about the possibility of alphabetising files and folders

As you can see the files are not ordered which can make it a little cumbersome to use

Screenshot 2020-11-05 at 11 47 25

Thanks.

doesn't work for me

The tool does not work for me.
Downloaded and put into /usr/local/bin and changed permissions to 755
When I run it, it just puts lines on my screen.
I am using macOS 10.15.7
Bildschirmfoto 2020-10-24 um 22 23 37

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.