Guest User

Untitled

a guest
Feb 21st, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. // The size of a file.
  2. + (unsigned int)fileSize: (NSString *)_path {
  3. NSString * destinationPath;
  4. if ( ![KSFFile makeDocPath:_path Result:&destinationPath] ) { return 0; }
  5.  
  6.  
  7. NSDictionary * dict = [[NSFileManager defaultManager] attributesOfItemAtPath:destinationPath error:nil];
  8. if ( !dict ) { return 0; }
  9.  
  10. NSNumber * size = [dict objectForKey:@"NSFileSize"];
  11. unsigned int retSize = [size intValue];
  12.  
  13. return retSize;
  14. }
Add Comment
Please, Sign In to add comment