Re: readdir vs. getdirentriesattr

2019-04-29 Thread Thomas Tempelmann
> The volume ID is at a higher layer, but the enumeration code attempts to > retrieve the value less than once per URL returned. That said, if the > directory hierarchy has few items per directory, the number of times it is > retrieved will be higher. You can write a bug report and I'll look to

Re: readdir vs. getdirentriesattr

2019-04-29 Thread Thomas Tempelmann
Quick update: > -[enumeratorAtURL:includingPropertiesForKeys:options:errorHandler:] also >> supports recursive enumeration (which stops at device boundaries -- you'll >> see mount points but not their contents) so you don't have to do that >> yourself. >> > This is indeed faster than most of the

Re: readdir vs. getdirentriesattr

2019-04-29 Thread Jim Luther
> On Apr 29, 2019, at 1:19 PM, Thomas Tempelmann wrote: > > Jim, > > In contentsOfDirectoryAtURL, instead of "includingPropertiesForKeys:nil", use > "includingPropertiesForKeys:@[NSURLVolumeIdentifierKey]" (and add whatever > other property keys you know you'll need). The whole purpose of

Re: readdir vs. getdirentriesattr

2019-04-29 Thread Thomas Tempelmann
Jim, In contentsOfDirectoryAtURL, instead of "includingPropertiesForKeys:nil", > use "includingPropertiesForKeys:@[NSURLVolumeIdentifierKey]" (and add > whatever other property keys you know you'll need). The whole purpose of > the includingPropertiesForKeys argument is so the enumerator code can

Re: readdir vs. getdirentriesattr

2019-04-29 Thread Jim Luther
In contentsOfDirectoryAtURL, instead of "includingPropertiesForKeys:nil", use "includingPropertiesForKeys:@[NSURLVolumeIdentifierKey]" (and add whatever other property keys you know you'll need). The whole purpose of the includingPropertiesForKeys argument is so the enumerator code can

Re: readdir vs. getdirentriesattr

2019-04-29 Thread Thomas Tempelmann
Doing more performance tests for directory traversal I ran into a performance issue with [NSURL contentsOfDirectoryAtURL:]: See this typical code for scanning a directory: NSArray *contentURLs = [fileMgr contentsOfDirectoryAtURL:parentURL includingPropertiesForKeys:nil options:0 error:nil];