-
-
Notifications
You must be signed in to change notification settings - Fork 40
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
Maximum of (ctime, mtime) - what I call "version time" or "vtime" #110
Comments
My understanding is that any time the If that's a concern, then you can use the fact that to write the equivalent of your proposed $ bfs -newerXc ... -and -newerXm ... and or
I'm not sure where that convention came from, but I don't think GNU find started it. The BSD finds have |
What prevents you from just using But your |
I think that would be a kernel bug if that happened. I did see some relevant Linux patches recently, e.g. https://lore.kernel.org/linux-fsdevel/[email protected]/
|
It is some pretty radical news to me that POSIX is (or always has been?!) requiring FWIW, I really only mentioned all this because Once you had, say, I could also see how adding These kinds of "heap filters" might be interesting more generally (e.g. as |
Yeah I don't know how the various UNIXes behave in practice here. But I did just check on my computer and
Indeed, and I think this might be doable with Almost all of
|
Yeah. I did go to the LKML archives and search around and while I'm convinced that Jeff Layton thinks POSIX says this to be true, I sure cannot find any primary POSIX-like sources that say so. I may check Austin next. There needs to be a nice version ctl log for all this stuff so I can just There is various traffic on LKML searching for The problem with your awk pipeline is that it has to do all that binary -> ASCII -> binary as well as then sort the whole thing -- including all that pathname data IO -- instead of just keeping a tiny heap-structured array of like 10 things (or N for top N). The top N problem is not perfectly local, in your terms, but it can still be very low resource. (The lgN per-heap operation costs are only lg10 here, too.) Well, for Anyway, I know how to do it various ways.. I perhaps should have been more clear that my interest here was more in brainstorming to help you improve your tool, not me solving some more concrete problem. I already have newest that does that heap approach that can even use my personal sys_batch Linux kernel module to do batch stat system calls if I'm in a Caffeine-Fueled Rage Optimization (CFRO) mode. :-) |
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html#tag_04_09 says
And e.g.
I don't know the details around
True, it is inefficient. (By the way, technically you can extract the top N items with a linear time selection algorithm. You can even do this online. But I'd guess a heap is better in practice.)
That's fair! There's basically three ways something gets added to
I see the value of a "find top 10 newest files" operation, but I think it doesn't outweigh the effort it would take to implement. I reserve the right to change my mind :)
Nice!
Also cool! Though I'm guessing you could use io_uring? |
Well, I found it in the |
I forgot that I neglected to answer about the Another part was/is to try to help put an example out there (another example?) not only for Linux, but any OS (or even any distributed system with pricey round-trips) with modules &| expensive system call boundaries, but also with a highly uniform/regular interface (like the Linux syscall interface). Once you have that regularity, a little batch-comparing-jump-forward-only nano-"assembly language" has a simple strength to it.
|
Yeah I looked in more detail after I made that comment and the little VM that's part of |
Personally, I am a bit at a loss why this kind of thing is not more prevalent all over and kind of like "old hat" if you know that expression. "Byte code" is freakin' everywhere. Maybe that just comes from the deep penetration of Emacs. Ideas need examples to copy/propaganda/something to spread. This one is kind of "too simple" for most academic paper circuits.. It would be some work to port it to all of the arch/'s Linux supports, of course. I once asked one of the Plan9 principals why 9p didn't have something like that. He said it was because the NJ group did not have enough feedback from the outside world which I thought was kind of an odd answer (but I think I might have been the 3rd person that particular day to ask him that question). But I often find myself at a loss for why the world is how it is and why we are so captive to existing toolkits. Reading your Anyway, I don't know why I write so much or mean to bother you. I liked the vibe of your "could've invented futexes" post. You seem like a smart fellow who might appreciate hearing my frustrations or share some was all. |
Especially (but not exclusively) on systems without
btime
, I often find it useful to find files newer than a given reference file/time. However, things likecp
andtar
have a way of altering the time backward or forward. When they do so they update thectime
(aka "the mtime for most inode metadata"). This makesmax(ctime, mtime)
a useful "synthetic" time stamp.It seems clearly useful to have this sort of thing built in to a find-like utility in things like
-newerXY
. I am unaware of tools beyond several of my own which integrate the concept. I mean, I know you could justprintf
both and take the max in a pipeline, but then you have to produce all the output to run the> max()
calculation against (binary->ASCII->binary cycles; blech). Much more efficient to do the various inequalities inside whatever evaluator the find-like tool is using. This also ought to be an extremely easy feature to add.About the only decision to make is what letter to use. I like lowercase
'v'
for "v)ersion", but I am not aware of this "version time" as standard terminology. I kind of doubt there is any more standard name. I partly chose "version" so that 'v' would not collide with 'm' (and also since 'm' would be ambiguous with min, as well as modification), but I find it "suggestive". I could be biased having used this abbreviation/term for almost a quarter century now, though..{ Personally, I think GNU find is kind of kooky for going with uppercase 'B' for birth time.. as if someone did that first with 'C' for creation as it is sometimes called outside Linux, and then thought better of it and changed to 'b' to disambiguate and then forgot to go lowercase to be consistent or some such silliness. So, if things are case-sensitive at all then you might want to make 'b' and alias for 'B'... but this is (more of) a nitpick. }
The text was updated successfully, but these errors were encountered: