Browse Source

fsync after every amalgamated file

Julius Pfrommer 8 years ago
parent
commit
93e79321c1
1 changed files with 3 additions and 2 deletions
  1. 3 2
      tools/amalgamate.py

+ 3 - 2
tools/amalgamate.py

@@ -68,8 +68,9 @@ for fname in args.inputs:
             guard_res = guard_re.match(line)
             if not inc_res and not guard_res:
                 file.write(line)
-                # Ensure file is written to disk.
-                file.flush()
+        # Ensure file is written to disk.
+        file.flush()
+        os.fsync(file.fileno())
         print ("done."),
 
 if not is_c: