[file_utils] unln: sync after copy
This commit is contained in:
parent
7f6d75cd64
commit
d77897fd5c
|
@ -129,6 +129,11 @@ for filename in sys.argv[1:]:
|
|||
verbose("Copying to temporary file", quote(tmpfilename), end="... ")
|
||||
shutil.copy2(filename, tmpfilename) # cp -p
|
||||
|
||||
# Try to sync if we are running Python >= 3.3
|
||||
if sys.version_info.minor >= 3:
|
||||
verbose("Syncing", end="... ")
|
||||
os.sync()
|
||||
|
||||
# Rename the temporary file with the original file name
|
||||
verbose("Moving back {} to {}...".format(
|
||||
quote(tmpfilename), quote(filename)))
|
||||
|
|
Loading…
Reference in New Issue