title: TransactionScope With Files In C#
body: <p>I've been using TransactionScope to work with the database and it feels nice. What I'm looking for is the following:</p>
  
  <pre><code>using(var scope=new TransactionScope())
  {               
      // Do something with a few files...
      scope.Complete();
  }
  </code></pre>
  
  <p>but obviously this doesn't work -- if there are 20 files, and an exception occurs on the 9th file, all previous 8 remain <em>changed</em> and the rest <em>unchanged</em> -- no rollback is performed. So, what would be the best way to implement a scope-like behavior for files?</p>
  
  <p>I'm hoping there is a simple answer, but if not, could you just give me a few pointers, or point me to an related article?</p>