Results 1 to 2 of 2
Hi All,
I want to sort the directory entries in a folder by access time.
Does Linux provide a certain C API for this task ?
There is readdir() function, ...
- 11-09-2009 #1Just Joined!
- Join Date
- Nov 2009
- Posts
- 43
C API to sort directory entries by access time
Hi All,
I want to sort the directory entries in a folder by access time.
Does Linux provide a certain C API for this task ?
There is readdir() function, however, as far as I see, it does not allow you to sort the file entries by access time.
scandir() function also exists, however, I am not sure if it is capable of doing the job.
Any help appreciated.
Thanks.
- 11-09-2009 #2Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,974
You are getting there. The function scandir() will do what you want. You have to provide the sorting function where you would use stat() or fstat() to access the status information about each file to allow it to sort on the access time.
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!


Reply With Quote