mooner Posted 3 hours ago Report Posted 3 hours ago Hi everyone, I have a question: Suppose there's a folder containing a large number of PNG images — say, around 10,000 files. What's the best way to get the name of the most recently created or modified image in that folder? Is there a faster method? Quote
Neil Pate Posted 1 hour ago Report Posted 1 hour ago Have you tried this? The `last mod` output should hopefully give you the timestamp of the last modification, and it would then be pretty simple to find the latest. I have no idea what the performance of this would be if you loop over 10000 files. That is something you would just have to try. Quote
Neil Pate Posted 1 hour ago Report Posted 1 hour ago Done some simple testing. On a directory containing 838 files it took 60 ms. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.