This chapter lists some common gotchas that should be avoided.
Removing inodes in unlink handler
If your file system is mounted at
mnt, the following code
should complete without errors:
with open('mnt/file_one', 'w+') as fh1:
with open('mnt/file_one', 'a') as fh2:
assert 'file_one' not in os.listdir('mnt')
assert fh1.read() == 'foobar'
If you’re getting an error, then you probably did a mistake when
unlink handler and are removing the
file contents when you should be deferring removal to the