A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2009-March/087135.html below:

[Python-Dev] wait time [was: Ext4 data loss]

[Python-Dev] wait time [was: Ext4 data loss] [Python-Dev] wait time [was: Ext4 data loss]Jim Jewett jimjjewett at gmail.com
Thu Mar 12 22:01:27 CET 2009
On 3/12/09, "Martin v. Löwis" <martin at v.loewis.de> wrote:
>> It is starting to look as though flush (and close?) should take an
>> optional wait parameter, to indicate how much re-assurance you're
>> willing to wait for.

> Unfortunately, such a thing would be unimplementable on most of today's
> operating systems.

What am I missing?

_file=file
class file(_file): ...
    def flush(self, wait=0):
        super().flush(self)
        if wait < 0.25:
            return
        if wait < 0.5 and os.fdatasync:
            os.fdatasync(self.fileno())
            return
        os.fsync(self.fileno())
        if wait < 0.75:
            return
        if os.ffullsync:
            os.ffullsync(self.fileno())

(To be honest, I'm not even seeing why it couldn't be done in
Objects/fileobject.c, though I realize extension modules would need to
go through the python interface to take advantage of it.)

-jJ
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4