public void WriteAllBytes(string path, byte[] contents) { var r = new RollbackFile(path); try { File.WriteAllBytes(path, contents); } catch (Exception e) { r.CleanUp(); throw new Exception(e.Message, e); } if (_tx != null) { _journal.Add(r); Enlist(); } }