Show warnings about un-stat-able files even with verbosity == 0

I get that this is some kind of a grey area due to the underlying race
condition (files vanishing after they have been scanned). However, if we
can't stat() a file it can have many different causes -- the file being
vanished is just one of them. Since this tool is meant to help detect
bit rot and corrupt file systems, I'd rather be informed about
un-stat-able files.
This commit is contained in:
Peter Hofmann 2016-09-21 17:37:36 +02:00
parent 5ed89d8b1a
commit 4e3c840eb0

View File

@ -201,14 +201,13 @@ class Bitrot(object):
# The file disappeared between listing existing paths and # The file disappeared between listing existing paths and
# this run or is (temporarily?) locked with different # this run or is (temporarily?) locked with different
# permissions. We'll just skip it for now. # permissions. We'll just skip it for now.
if self.verbosity: print(
print( '\rwarning: `{}` is currently unavailable for '
'\rwarning: `{}` is currently unavailable for ' 'reading: {}'.format(
'reading: {}'.format( p_uni, ex,
p_uni, ex, ),
), file=sys.stderr,
file=sys.stderr, )
)
continue continue
raise # Not expected? https://github.com/ambv/bitrot/issues/ raise # Not expected? https://github.com/ambv/bitrot/issues/