Comments (5)
Okay, the root cause is a symlink that points to a non-existing file. nat can not deal with that
from nat.
"the better ls" lmao. Two rust files, not even on homebrew, one option (-f), can't list "/", written by somoene who probably spent more time on his github about section than his code.
And a big German newspaper made an article about it: https://www.heise.de/news/In-Rust-geschrieben-und-uebersichtlicher-nat-will-ls-ersetzen-4937429.html
from nat.
While it might technically be true, that this a few thousand lightyears behind ls in.. everything it is also true, the the account that created this has a factor 30 higher activity on Github last year than you....
Going back to-topic, I replaced calls to metadata
with symlink_metadata
, which quit unintuitively does not follow symlinks, and thus doesn't fail when encountering a dangling one.
I think a better solutions is changing this
let entries = fs::read_dir(directory)?
.map(|res| res.map(|e| e.path()))
.collect::<Result<Vec<_>, io::Error>>()?;
to create a Vector containing the pathes/dsiplay strings and all metadata, to get rid of the metadata calls all over the place (I think it only possible by hand, creating a mutable vector and filling it. Then it could also detect what a symlink is, and change the string to "symlinkname->symlinktarget" as in ls. but maybe there is some RUST-fu magician out there how can map the hell out of it, doing it in one go...)
Also I think using the ?
operator after having read the initial directory list is a bad design choice for this tool, because it will make the program fall over whenever stumbling across some unexpected things...
from nat.
Thanks to @SebastianSchildt symlinks now work. Thread closed.
from nat.
from nat.
Related Issues (20)
- TimeZone HOT 1
- Alphabetical HOT 5
- Snap release updates HOT 7
- headlines -l flag doesn't add headlines HOT 2
- Relative timestamps HOT 8
- Endless loop printing whitespaces HOT 2
- thread 'main' panicked at 'called `Option::unwrap()` on a `None` value' HOT 2
- Do you have something like this for windows? HOT 2
- Date and time are zeros HOT 9
- V2.1.9 is not pushed to GitHub HOT 2
- Add windows compatibility. HOT 6
- Windows 10 HOT 1
- Searching for nonexistent file or directory returns Rust error HOT 4
- thread 'main' panicked at 'called `Option::unwrap()` HOT 6
- Group and date joined together HOT 8
- Error when running nat on unaccessible directory HOT 17
- Build Error HOT 1
- Better info description in README HOT 6
- What's special about nat?
- Difference to exa? https://github.com/ogham/exa HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nat.