title: Writing an NSString to a Relative File
body: <p>I'm getting strange behavior writing NSString and NSData objects to relative file paths. Here's an example:</p>
  
  <pre><code>NSString *string = @"I am a file!";
  NSError *error =  nil;
  NSString *fileName = @"text.txt";
  BOOL written = [string writeToFile:fileName atomically:YES encoding:NSUTF8StringEncoding error:&amp;error];
  
  if (written) {
      NSLog(@"Successfully written to file.");
  } else {
      NSLog(@"Error: %@", [error localizedDescription]);
  }
  </code></pre>
  
  <p>When I run this I always get "Successfully written to file.", but the file is never there. Somehow the program thinks it was successful and no error is generated.</p>
  
  <p>What am I doing wrong? (I'm on Mac OS X Lion)</p>