After seeing: >backup kept screwing up until FileStorage's > > if fsync is not None: fsync(file.fileno()) > >actually did something on Windows. > I suspect making the change where you obtain fsync, rather than where you call it makes the code clearer. Just after import os, you can do the appropriate bit of the following code: try: fsync = os.fsync except AttributeError: fsync = lambda filenumber: None # Unfortunately nothing to call -------- or -------- fsync = os.fsync or lambda filenumber: None # if we cannot sync, do nothing This (at least to me) emphasizes the lack of a system facility. The existing code emphasizes local solutions on a case-by-case basis. If the solution is always to skip the call, I'd find this method clearer. -Scott Daid Daniels Scott.Daniels at Acm.Org
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