we could probably make:
```
            outfile = os.fdopen(os.open(os.path.join(directory, filename), os.O_RDWR | os.O_CREAT | os.O_EXCL), 'w')
            outfile.write(self.read(path_name))
            outfile.close()
```

a method, so we can patch it easily for tests

and if we want to test those bits on real files, it would be a smaller simpler set of things to create/cleanup