Previously, we attempted to perform a clean shutdown, which could take a
significant period of time on slow filesystems. This commit changes the
shutdown logic to abort immedietly when ^C is received by the program.
If we run `dust /usr/*/Trash`
We see several 'Trash' directories in the output but do not know which
user they belong to.
This fix means if we see duplicate names in a directory we will display
the parent directory name as well
Previously, the function get_metadata in platform.rs used `fs::metadata` which follows symbolic links
and returns metadata for the target file. This caused issues #421: du / dust disagreement
when trying to determine properties of the symbolic link itself
This PR addresses an issue where `target_dirs` were being optimized out\
before being passed to the `get_filesystem_devices()` function.
The changes in this PR ensure that `target_dirs` are passed directly
to `get_filesystem_devices()`, and only then are they simplified.
Example of a command that currently doesn't work correctly:
```sh
dust -x $(findmnt -S tmpfs -o target -n)
```
It should show the usage of all tmpfs mounts, but it currently shows
just the the root mountpoints like `/run`, since all the mountpoints
nested under it are optimized out.
add new option: --output-format this controls how the output is
summarised and takes:
nothing = default behaviour
si = SI units (same as old --si flag)
b = bytes
kb = kb
kib = si kb
mb = mb
mib = si mb
....etc
Provide "No such file or directory" error if file is not found.
Provide "Unknown Error" if other error found
Should reduce confusion from the generic other error
If a user reports a crash from stacksize - we can try different stack
memory sizes to try and figure out the cause.
Do not try and initialise rayon on 32 bit builds
Fix rayon initialisation, may not have been called before due to badly
formed closure
- If `--depth` flag is not defined (or it has an invalid value), a value
from the config file will be used.
- If no `depth` entry in the config file (or there is no config file),
the default `usize::MAX` will be used.
Added test cases:
- no config and no flag defined -> `usize::MAX` should be used
- config defined, but flag is not defined -> config value should be used
- config is not defined, but flag is defined -> flag value should be used
- both config and flag is defined -> flag value should be used
Additional changes:
- Fixed some clippy issues.
- Added comments to the example `config.toml` file.
(copy from flag description)
Closes: #314
Signed-off-by: Balazs Nadasdi <efertone@pm.me>
Reduce & simlpify.
Cut feature: where we only report file count, it is always
useful to see file size as well.
cut feature: plural of file. If dust has only indexed a single file by
the time it prints the status then something has gone wrong, safe to
always assume a plural.