-
-
Notifications
You must be signed in to change notification settings - Fork 817
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add --ctime
(change time) filter option to fd
#1437
Comments
Hello, @Inkbottle007 , I can implement this but I have some questions. You want to
For For I'm not sure if I'm overthinking it or if it goes beyond common scenarios, but I think |
Hi, @sharkdp , I find this issue has been open for 2 weeks and I don't know whether this feature is necessary or not in your repo. If I'm allowed to do this, I have questions about what should I do to the original arguments related to Users are accustomed to using Should I use |
|
Using brime requires support not only from the OS, but from the filesystem. On linux at least, getting btime requires a separate syscall, statx, than the stat we currently use. I'm not saying it can't be done, but it isn't quite as simple as just comparing a different attribute. |
I just noticed that. |
Implementing |
On Windows, I find some data structures about On Linux/Unix, it's easy to make it work for
|
ctime on MetadataExt is available on all Unix variants, which would include all supported OSes except for windows. I don't think that being unix only would be a blocker to merging it. It wouldn't be the first option that is specific to unix oses. |
I am trying to write test for Here are 2 options to handle this
I don't have much experience with this, can you give me some suggestions? |
I get it. I wasn't aware of that point that Windows doesn't have a "change time". So it seems that the timestamp features of |
Yes, it's platform dependent at this moment.
Windows do have corresponding #[repr(C)]
pub struct FILE_BASIC_INFO {
pub CreationTime: i64, // btime
pub LastAccessTime: i64, // atime
pub LastWriteTime: i64, // mtime
pub ChangeTime: i64, // ctime
pub FileAttributes: u32,
} but I don't have much experience with Rust on Windows, I also tried crate This feature could be implemented by someone who is more experienced. |
I just got bitten by the fact that |
It happened to me too. I was naively expecting that |
Yeah, at this point I don't think it would be possible to change the behavior of the existing options. |
Saw my issue was tagged here so just dropping a note, I got the ok w/ my PR to add change_time as an unstable feature. Here is the tracking issue -- rust-lang/rust#121478 |
Dear
fd
maintainers,I’d like to suggest an enhancement for
fd
: the inclusion of a--ctime
(change time) filter option. Currently, sorting and filtering by modification time (mtime
) is quite common, which is certainly useful in many scenarios. However, there are instances wherectime
provides additional value.For example, after downloading a file like the "C ANSI manual" (http://www1.cs.columbia.edu/~sedwards/papers/sgi1999c.pdf), one might expect to find it at the top of a sorted directory list. But if the
mtime
hasn’t been altered since the download, it might not appear at the top as expected, even though itsctime
has been updated upon download.I find myself relying on
ctime
in these scenarios to locate recently downloaded or moved files that do not have a recentmtime
. While this is the primary use case that prompts my request, I’m confident others could benefit from actime
filter as well.I noticed there has been some previous discussion on this topic (#165 (comment)), indicating I’m not alone in valuing this feature.
I believe adding a
--ctime
option could be a valuable enhancement tofd
's functionality.Thank you for your time and for maintaining such a useful tool.
Best regards,
Chris
The text was updated successfully, but these errors were encountered: