diff options
author | Lars Wirzenius <liw@liw.fi> | 2011-02-12 23:44:39 +0000 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2011-02-12 23:44:39 +0000 |
commit | e6357e4ee0d95eac3973452723010017eacf04a4 (patch) | |
tree | a0edcbcb3d2fdc67be9e507cb83517b42369e84b /summainlib.py | |
parent | c843b1d069f1d82cf4a8758ffa3a3325fd5a82fd (diff) | |
download | summain-e6357e4ee0d95eac3973452723010017eacf04a4.tar.gz |
Don't report size for directories.
It is meaningless.
Diffstat (limited to 'summainlib.py')
-rw-r--r-- | summainlib.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/summainlib.py b/summainlib.py index 31b42a7..7f67908 100644 --- a/summainlib.py +++ b/summainlib.py @@ -99,7 +99,8 @@ class FilesystemObject(object): self['Ino'] = '%d' % normalizer.get_ino(stat_result.st_ino) self['Dev'] = '%d' % normalizer.get_dev(stat_result.st_dev) self['Nlink'] = '%d' % stat_result.st_nlink - self['Size'] = '%d' % stat_result.st_size + if not stat.S_ISDIR(stat_result.st_mode): + self['Size'] = '%d' % stat_result.st_size self['Uid'] = '%d' % stat_result.st_uid self['Username'] = self.lookup_username(stat_result.st_uid) self['Gid'] = '%d' % stat_result.st_gid @@ -146,3 +147,4 @@ class FilesystemObject(object): for x in sorted(self.values.keys()) if x != 'Name'] return ''.join('%s: %s\n' % (key, self[key]) for key in keys) + |