[sysadmin-bin] ftpadmin: explicitly flush contents to disk



commit a78f81348465a876debf9f2ef6ea5fd18f042a7d
Author: Olav Vitters <olav vitters nl>
Date:   Sun Mar 27 14:19:08 2011 +0200

    ftpadmin: explicitly flush contents to disk

 ftpadmin |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/ftpadmin b/ftpadmin
index f155171..7859816 100755
--- a/ftpadmin
+++ b/ftpadmin
@@ -420,6 +420,7 @@ class TarInfo(BasicInfo):
                     if break_for:
                         break
                 if lines > 2:
+                    f.flush()
                     diffs[fn] = f
                     if progress:
                         print ", done (diff, %s lines)" % lines
@@ -432,6 +433,7 @@ class TarInfo(BasicInfo):
                 # succesfully read previous tarball, didn't find a 'NEWS' / 'ChangeLog'
                 # assume file has been added in this release and no diff is needed
                 f.writelines(self.file[fn])
+                f.flush()
                 diffs[fn] = f
                 print ", done (new file)"
             else:



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]