How do I use Carbon or CoreFoundation (preferably the latter) to list the contents of a directory?
A:
I don't think CoreFoundation has any way to do it. With Carbon, one could use repeated calls to FSGetCatalogInfoBulk. But, just curious, why not use BSD or Cocoa methods?
JWWalker
2010-06-29 20:45:01
I can't use Cocoa as this project must be in C++, and no, Objective-C++ is not an option here. I can't really use BSD functions cleanly as I'm looking for the same list of files I'd get in Finder.
Anonymous
2010-06-29 21:28:36
Not sure what you mean by "same list of files I'd get in Finder". Same order? Same files hidden? Using Carbon will not guarantee either of those.
JWWalker
2010-06-29 22:25:01
The BSD functions will also show those special Unix files like ".", ".DS_Store", etc. While I probably can write more code to filter those out, I just want to know if there's a cleaner and more OS X-like way to do it with Carbon.
Anonymous
2010-06-29 23:40:04