Per Jessen wrote:
David Haller wrote:
Could you compare an
$ ltrace -S -efile ...
of ls/find vs. your "just getdents" code? A small sample dir (-tree) should suffice to spot the diff (when ls/find don't sort)...
Yep, that sounds interesting, I'll try that tomorrow.
These are the traces: https://files.jessen.ch/ltrace-find.log (find -mtime) https://files.jessen.ch/ltrace-ls.log (ls -f) https://files.jessen.ch/ltrace-lsdir.log (my code) The directory is "cur". A quick glance at ls and find, and I see roughly the same behaviour - open("cur") followed by streaming getdents(). 'ls' uses mmap, 'find' does not. (both ran for less than a minute). My code (largely borrowed from the man page) - open("cur") getdents stat stat write . . . . . getdents stat stat write The extra stat call is because I call ctime() to print the mtime. -- Per Jessen, Zürich (5.8°C) http://www.hostsuisse.com/ - dedicated server rental in Switzerland. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org