From 6541b5b4aff648a111196180aa790f750ccaa45d Mon Sep 17 00:00:00 2001 From: Markus Unterwaditzer Date: Sun, 22 Feb 2015 14:54:03 +0100 Subject: [PATCH] Don't do fsync on unix --- vdirsyncer/utils/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vdirsyncer/utils/__init__.py b/vdirsyncer/utils/__init__.py index 84cfba0..d0ebd9e 100644 --- a/vdirsyncer/utils/__init__.py +++ b/vdirsyncer/utils/__init__.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- import os +import sys import threading import requests @@ -279,7 +280,8 @@ def get_etag_from_fileobject(f): doesn't change its mtime. ''' f.flush() # Only this is necessary on Linux - os.fsync(f.fileno()) # Apparently necessary on Windows + if sys.platform == 'win32': + os.fsync(f.fileno()) # Apparently necessary on Windows return get_etag_from_file(f.name)