title: NSFileManager: Continue writing to disk in background?
body: <p>in my iPhone app, I am using the default NSFileManager to copy and move some data around. The amount of data may be some MB, so it may take several seconds to finish copying. If the user now starts a copy process and quits the application, can I continue writing to disk in background mode? If so, how? I do not want to start a new copy process, but only finish the running one. </p>
  
  <p>I am currently using two kinds of method calls: </p>
  
  <pre><code>[imageData writeToFile:path atomically:YES];
  </code></pre>
  
  <p>and</p>
  
  <pre><code>[fm copyItemAtPath:sourcePath toPath:destinationPath error:&amp;error];
  </code></pre>
  
  <p>Both calls are wrapped in another method and are performed in the background via <code>-performSelectorInBackground:withObject:</code>.</p>
  
  <p>Another question is if I can get any information on how far the writing operation has progressed or at least if it has already finished?</p>
  
  <p>EDIT: Some more information:
  Currently, I did not implement any background tasks at all. What happens to running disk operations when the user presses the home button? Are they just cut off and the file is incomplete? Can I continue writing on the next start? Are they canceled and the incomplete file is removed?</p>
  
  <p>To sum it all up: I am writing data to disk and I want it to stay consistent when the user presses the home button during a writing operation. How do I achieve this? </p>