rat
is a performance oriented re-implementation of cat
in rust
See rat.rs
For a fully fledged coreutils rust stack see uutils
:
https://github.com/uutils/coreutils/
rat
vs. cat
```
$ rat $ cat $ echo test | ./rat - /does/not/exists /etc/hosts /does/not/exists2 | md5sum
rat: /does/not/exists: No such file or directory
rat: /does/not/exists2: No such file or directory
27f2e6689a97a42813e55d44ef29cda4 - $ echo test | cat - /does/not/exists /etc/hosts /does/not/exists2 | md5sum
cat: /does/not/exists: No such file or directory
cat: /does/not/exists2: No such file or directory
27f2e6689a97a42813e55d44ef29cda4 - ``` I just wanted to do this as a learning experience for rust. At least, that's how it started. Things learned in relation to rust: Wrap the raw file descriptor in Even when that vector is immediately cleared on runtime the behavior between initially empty vs. initially Sized vector is noticeableMotivation
Stdout
in rust will always be wrapped by LineWriter
which flushes on new lineBufWriter<File>
instead for more control
Vec<u8>
for buffer has some interesting impacts on runtime performanceKnown Bugs