Håkan Waara wrote:
Hello all!
Hopefully, I'm missing something obvious, but I haven't found an
elegant way to get the count of files in a directory using XPCOM.
nsIFile only has isDirectory()
(http://lxr.mozilla.org/seamonkey/source/xpcom/io/nsIFile.idl#265), and
it has the attribute directoryEntries
(http://lxr.mozilla.org/seamonkey/source/xpcom/io/nsIFile.idl#336) -
which gives me an enumerator.
Using that, I can manually iterate over all files and add them up.
That's about the simplest way I've found.
I'd prefer not having to iterate over all files in directory, if all I
want is the count of items in it.
Any ideas?
/Håkan
No, enumerating is the right way.
Doug
_______________________________________________
dev-tech-xpcom mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-xpcom