Permalink
Browse files

Do not write metadata for empty files

  • Loading branch information...
KonishchevDmitry committed Dec 18, 2012
1 parent 1e97142 commit f008cc3e3c0a4b7951ce433837111555f7556bf9
Showing with 5 additions and 2 deletions.
  1. +5 −2 pyvsb/backup.py
View
@@ -49,7 +49,6 @@
# TODO: lzma
-# TODO: don't add empty files to metadata
class Backup:
"""Controls backup creation."""
@@ -150,7 +149,11 @@ def add_file(self, path, stat_info, link_target = None, file_obj = None):
inode = ( stat_info.st_dev, stat_info.st_ino )
link_target = self.__hardlink_inodes.get(inode)
- has_data = ( file_obj is not None and link_target is None )
+ has_data = (
+ link_target is None and
+ file_obj is not None and
+ stat_info.st_size
+ )
# Try to deduplicate backed up files
if has_data:

0 comments on commit f008cc3

Please sign in to comment.