diff options
author | 2012-12-15 09:24:30 +0100 | |
---|---|---|
committer | 2012-12-15 09:24:30 +0100 | |
commit | 3f9646058bfd91d7d0e2eda035521f97de92eabc (patch) | |
tree | 96209d4c5c53621f53442a259a5fd20a20a4f383 | |
parent | Add silent mode. (diff) | |
download | gmail-notmuch-3f9646058bfd91d7d0e2eda035521f97de92eabc.tar.xz gmail-notmuch-3f9646058bfd91d7d0e2eda035521f97de92eabc.zip |
Remember to fsync in case of power failure.
-rwxr-xr-x | gmail-notmuch.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/gmail-notmuch.py b/gmail-notmuch.py index 6157462..08d6370 100755 --- a/gmail-notmuch.py +++ b/gmail-notmuch.py @@ -202,6 +202,8 @@ def download_new_messages(imap, database, messages, destination): sys.exit("Failed to download message gmail-%d/imap-%d" % (gmail_id, imap_seq)) f = open(temp, "w") f.write(data[0][1]) + f.flush() + os.fsync(f.fileno()) f.close() os.link(temp, dest) # Because DJB says so... os.unlink(temp) |