title: How to make a directory iOS?
body: <p>Okay,</p>
  
  <p>So I have a Cydia app that I need to update. I am aware with Cydia apps that they don't have a Documents folder, so you have to make one. And here's how I made it before in iOS 4 (which doesn't work on iOS 5): </p>
  
  <pre><code>mkdir("/var/mobile/Library/APPNAME", 0755);
  mkdir("/var/mobile/Library/APPNAME/Documents", 0755);
  
  NSString *foofile = @"/var/mobile/Library/APPNAME/Documents/database.db";
  BOOL fileExists = [[NSFileManager defaultManager] fileExistsAtPath:foofile];
  
  if (fileExists == TRUE) {
      NSLog(@"already exists");
  } else {
      NSLog(@"doesn't exists");
      NSFileManager *fileManager = [[NSFileManager defaultManager]autorelease];
      NSError *error;
      NSString *documentDBFolderPath = @"/var/mobile/Library/APPNAME/Documents/database.db";
  
      NSString *resourceDBFolderPath = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"database.db"];
      [fileManager copyItemAtPath:resourceDBFolderPath toPath:documentDBFolderPath error:&amp;error];
  
  }
  </code></pre>
  
  <p>I also included code that copies the database file to that folder, too. That doesn't work (even when I create the folder manually via SSH). </p>
  
  <p>Please help! Thanks.</p>