Created
March 6, 2012 02:14
-
-
Save fukata/1982914 to your computer and use it in GitHub Desktop.
iOS file informations.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); | |
NSString *dir = [paths objectAtIndex:0]; | |
NSLog(@"dir=%@", dir); | |
NSString *filePath = [dir stringByAppendingPathComponent:@"hoge.flv"]; | |
NSLog(@"filePath=%@", filePath); | |
NSFileManager *fm = [NSFileManager defaultManager]; | |
BOOL exists = [fm fileExistsAtPath:filePath isDirectory:NO]; | |
BOOL writable = [fm isWritableFileAtPath:filePath]; | |
BOOL readable = [fm isReadableFileAtPath:filePath]; | |
BOOL executable = [fm isExecutableFileAtPath:filePath]; | |
NSDictionary *file = [fm attributesOfItemAtPath:filePath error:nil]; | |
NSLog(@"exists=%d, writable=%d, readable=%d, executable=%d, size=%lld", exists, writable, readable, executable, [file fileSize]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment