#import
<Cocoa/Cocoa.h>
int main(int
argc, const
char * argv[]) {
NSMutableArray *directoryDict = [NSMutableArray
new];
[directoryDict addObject:@{@"url":[NSURL
URLWithString:NSHomeDirectory()],
@"id":@(0)}];
NSInteger Id =
1;
while (directoryDict.count
!= 0) {
NSDictionary *info = [directoryDict
firstObject];
[directoryDict removeObject:info];
NSDirectoryEnumerator *directoryEnumerator = [[NSFileManager
defaultManager]
enumeratorAtURL:info[@"url"]
includingPropertiesForKeys:nil
options:NSDirectoryEnumerationSkipsHiddenFiles
errorHandler:nil];
for(NSURL
*fileURL in directoryEnumerator) {
[directoryEnumerator skipDescendants];
NSLog(@"%@",fileURL);
NSNumber *isDirectory=nil;
NSError *error=nil;
[fileURL
getResourceValue:&isDirectory
forKey:NSURLIsDirectoryKey
error:&error];
if([isDirectory
isEqualTo:@YES])
{
[directoryDict addObject:@{@"url":fileURL,
@"id":@(Id)}];
}
Id++;
}
info = nil;
}
return
NSApplicationMain(argc, argv);
}