os.Readdirnames() just returns dir enry names[1], while
os.Readdir() lstats all the dir entries.

Pretty much every OS's (C lang) readdir() returns a direntry's
type without having to stat the underlying file.  More often
than not this is all one wants -- not everyone wants to walk a
directory tree -- and even there filepath.Walk() lstats all
the files unnecessarily.

I have directories with thousands of files and a very smal
number of subdirs so the lstat overhead is considerable.

Is there a package that does ReadDirents() returning a pair
([]string, []byte) or []struct {type byte; name string}?

Thanks,
Bakul

[1] Not to mention the name "Readdirnames" is not quite right
as it does not read the directory's names!

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to