cat: manage folder error
Created by: Mojo4242
Hi,
When using cat on a folder e.g.
# cat /
/: other os error
I would be nice to have a more explicit error like /: Is a directory
I suppose this should be handled in cat as ErrorKind
in rust/src/libstd/io/errors.rs
apparently don't manage this kind of error.
A naive approach would be to check error type and in case of ErrorKind::Other
, check if the provided path is a folder.
This is my first ticket for Redox so be free to comment and/or tell me if this kind of ticket is polluting.
rustc -V :
rustc 1.17.0-nightly (29dece1c8 2017-02-08)
rustup show :
Default host: x86_64-unknown-linux-gnu
nightly-x86_64-unknown-linux-gnu (default)
rustc 1.17.0-nightly (29dece1c8 2017-02-08)
git rev-parse HEAD :
ac1cd89b5cc5db76d4054d64463c6b0d599e5d43
qemu-system-x86_64 -version :
QEMU emulator version 2.5.0 (Debian 1:2.5+dfsg-5ubuntu10.8), Copyright (c) 2003-2008 Fabrice Bellard
uname -a :
Linux 74ae79d00b85 4.9.4-moby #1 SMP Wed Jan 18 17:04:43 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux