Creates and returns a directory enumerator with provided enumerator behavior options and properties to be prefetched.


func CFURLEnumeratorCreateForDirectoryURL(_ alloc: CFAllocator!, _ directoryURL: CFURL!, _ option: CFURLEnumeratorOptions, _ propertyKeys: CFArray!) -> CFURLEnumerator!



The memory allocator to use. If NULL, the default allocator is used.


The URL of the directory to enumerate.


A bit array of enumerator behavior options.


An array of file property keys to prefetch for each enumerated URL. Can be NULL.

Return Value

The created directory enumerator.


Directory enumerators do not descend into subdirectories of directoryURL by default. To create a recursive enumerator, include the descendRecursively option in options.

Specifying prefetch properties allows the enumerator to optimize device access by using bulk operations. However, you should not prefetch properties that are not needed, because doing so may degrade performance.

The created directory enumerator generates URLs with the same type as directoryURL. If directoryURL is a file reference URL, then enumerated URLs are file reference URLs. If directoryURL is a file path URL, then enumerated URLs are file path URLs.

In some areas of the file system hierarchy, file reference URLs cannot be generated. The enumerator always generates file path URLs for these areas.

This function ignores the generateFileReferenceURLs option.

See Also