Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 13th, 2012  |  syntax: None  |  size: 0.89 KB  |  hits: 18  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. NSFileManager unable to view below certain directories
  2. NSString *path = @"/private/var/mobile/Applications/";
  3.         NSFileManager *manager = [NSFileManager defaultManager];
  4.         NSArray *fileList = [manager contentsOfDirectoryAtPath:path error:nil];
  5.  
  6.  
  7.             for(NSString *file in fileList) {
  8.  
  9.  
  10.   NSString *fullpath = [path stringByAppendingPathComponent:file];
  11.             NSLog(@"fullpath = %@", fullpath);
  12.  
  13.         BOOL isDir = nil;
  14.             [manager fileExistsAtPath:fullpath isDirectory:(&isDir)];
  15.             if(isDir) {
  16.                 NSLog(@"isDir");
  17.                 //NSArray *subfiles = [self filesBeneathDirectory:fullpath withExtension:extension];
  18.             } else {
  19.  
  20.  
  21.             NSLog(@"!isDir");
  22.                     NSDictionary *attributes = [manager attributesOfItemAtPath:fullpath error:nil];
  23.                     NSLog(@"attributes = %@",attributes);
  24.             }
  25.  
  26.      }