Byron / dua-cli

View disk space usage and delete unwanted data, fast.
https://lib.rs/crates/dua-cli
MIT License
4.19k stars 113 forks source link

support showing timestamps for files/dirs #67

Closed juhp closed 12 months ago

juhp commented 4 years ago

It is often useful to know how old a file or directory is when deciding if it can be deleted say. It would be a nice feature to add to dua in my opinion: I don't think they need be cached.

Byron commented 4 years ago

I agree, this part of the metadata wouldn't have to be stored for all files it iterates. Instead it could be extracted from the meta-data that is queried each time a level of files is displayed. This is currently used to indicate missing files in red (useful to see they have been deleted already).

It would be worth figuring out which timestamp exactly should be chosen, last modified time, or creation time. My intuition is modified time.

juhp commented 4 years ago

Any pointers or suggestions how to tackle this? I am mostly a rust newbie alas, but I don't mind at least trying to poke around a bit to see what I can find out.

Byron commented 4 years ago

The entries panel (the one you are interested in) is drawn here.

Currently it only knows about the existence of an entry, but that could be extended here.

The trickier bits should be around drawing the dates correctly, but that is usually a matter of experimentation with cargo run -- i.

If you have more questions or trouble, please feel free to post here for some help.

gosuwachu commented 12 months ago

IMHO this is now done.

Byron commented 12 months ago

Agreed 👍.