20090617

FSGetCatalogInfoBulk

I use this call to iterate over directory contents with fewer system calls. Sometimes, I delete files, and I need to open the iterator with kFSIterateDelete. The implementation is such that kFSIterateFlat was supposed to be able to permit such a delete-file operation, but does not in fact.
While testing the code, we commented out the actual delete, and found that the last n files in the directory were improperly processed. When we commented the delete back in, everything was cleared up.
The moral here is clear: When you open an FSIterator with the kFSIterateDelete flag, make sure to delete the files!

No comments:

Post a Comment