15.02.12 23:16, Charles-François Natali написав(ла):
Issue #8604 aims at adding an atomic file API to make it easier to
create/update files atomically, using rename() on POSIX systems and
MoveFileEx() on Windows (which are now available through
os.replace()). It would also use fsync() on POSIX to
Martin v. Löwis v.loewis.de> writes:
> One way of providing this might be a "u" mode for open, which
> updates an existing file on close (unlike "a", which appends,
> and unlike "w", which truncates first).
Doesn't "r+" cover this?
Regards,
Vinay Sajip
Am 16.02.2012 10:54, schrieb Victor Stinner:
> Most users don't need a truly ACID write, but implement their own
> best-effort function. Instead of having a different implement in each
> project, Python can provide something better, especially when the OS
> provides low level function to implement
Most users don't need a truly ACID write, but implement their own
best-effort function. Instead of having a different implement in each
project, Python can provide something better, especially when the OS
provides low level function to implement such feature.
Victor
2012/2/16 "Martin v. Löwis" :
> (MvL complained in the tracker issue about a lack of concrete use
> cases, but I think fixing race conditions when overwriting bytecode
> files in importlib and the existing distutils/packaging use cases
> cover that)
I certainly agree that there are applications of "atomic replace", and
that th
On Thu, Feb 16, 2012 at 11:49 AM, Ben Finney wrote:
> No, I have no objection to that implementation. I'm pointing that out
> only because the nature of the functionality implies I'd expect to find
> it within the ‘os’ module hierarchy.
The (very) rough rule of thumb is that the os module handles
Brian Curtin writes:
> On Wed, Feb 15, 2012 at 19:19, Ben Finney wrote:
> > Charles-François Natali writes:
> >
> >> […] using rename() on POSIX systems and MoveFileEx() on Windows
> >> (which are now available through os.replace()). It would also use
> >> fsync() on POSIX to make sure data is
On Wed, Feb 15, 2012 at 19:19, Ben Finney wrote:
> Charles-François Natali writes:
>
>> Issue #8604 aims at adding an atomic file API to make it easier to
>> create/update files atomically, using rename() on POSIX systems and
>> MoveFileEx() on Windows (which are now available through
>> os.repla
Charles-François Natali writes:
> Issue #8604 aims at adding an atomic file API to make it easier to
> create/update files atomically, using rename() on POSIX systems and
> MoveFileEx() on Windows (which are now available through
> os.replace()). It would also use fsync() on POSIX to make sure da
On Thu, Feb 16, 2012 at 9:29 AM, Steven D'Aprano wrote:
> Charles-François Natali wrote:
>> What would be the best place for a such a class?
>> _pyio, tempfile, or a new atomicfile
>
>
> shutil perhaps?
>
> As a user, that's the third place I look for file utilities, after builtin
> functions and
Charles-François Natali wrote:
Hi,
Issue #8604 aims at adding an atomic file API to make it easier to
create/update files atomically, using rename() on POSIX systems and
MoveFileEx() on Windows (which are now available through
os.replace()). It would also use fsync() on POSIX to make sure data i
Hi,
Issue #8604 aims at adding an atomic file API to make it easier to
create/update files atomically, using rename() on POSIX systems and
MoveFileEx() on Windows (which are now available through
os.replace()). It would also use fsync() on POSIX to make sure data is
committed to disk.
For example,
12 matches
Mail list logo