Марк Коренберг added the comment:

So, maybe API change? like delete=True|False|Maybe ? don't think that this is 
good decisions.

My approach is based on ext4 behaviour about delayed allocation and atomic file 
replacements.
In my case, either old file (with contents) or new file appear.
In any case, corrupted data cannot appear.
This is required behaviour for my application.


https://www.kernel.org/doc/Documentation/filesystems/ext4.txt
http://lwn.net/Articles/322823/

=======================================================================
auto_da_alloc(*)        Many broken applications don't use fsync() when 
noauto_da_alloc         replacing existing files via patterns such as
                        fd = open("foo.new")/write(fd,..)/close(fd)/
                        rename("foo.new", "foo"), or worse yet,
                        fd = open("foo", O_TRUNC)/write(fd,..)/close(fd).
                        If auto_da_alloc is enabled, ext4 will detect
                        the replace-via-rename and replace-via-truncate
                        patterns and force that any delayed allocation
                        blocks are allocated such that at the next
                        journal commit, in the default data=ordered
                        mode, the data blocks of the new file are forced
                        to disk before the rename() operation is
                        committed.  This provides roughly the same level
                        of guarantees as ext3, and avoids the
                        "zero-length" problem that can happen when a
                        system crashes before the delayed allocation
                        blocks are forced to disk.
=======================================================================

So, this is essential functionality.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue21579>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to