How can I execute hidden directory and files programmatically?
i.e: .DS_Store
I want to execute all the hidden files and direct
Use NSFileManager
with NSDirectoryEnumerationSkipsHiddenFiles
.
For example:
NSFileManager *fileManager = [NSFileManager defaultManager];
NSArray *theFiles = [fileManager contentsOfDirectoryAtURL:[NSURL fileURLWithPath:@"/Users/Anne/Desktop/"]
includingPropertiesForKeys:[NSArray arrayWithObject:NSURLNameKey]
options:NSDirectoryEnumerationSkipsHiddenFiles
error:nil];
NSLog(@"%@",theFiles);