How can I execute hidden directory and files programmatically?
i.e: .DS_Store
I want to execute all the hidden files and directories which start with the "."
Thank you for your help in advance
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);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With