From 4e3c840eb000d1455a6b752416f6a34c6a948c75 Mon Sep 17 00:00:00 2001 From: Peter Hofmann Date: Wed, 21 Sep 2016 17:37:36 +0200 Subject: [PATCH] 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. --- src/bitrot.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/bitrot.py b/src/bitrot.py index 1f27a0a..8c7305e 100644 --- a/src/bitrot.py +++ b/src/bitrot.py @@ -201,14 +201,13 @@ class Bitrot(object): # The file disappeared between listing existing paths and # this run or is (temporarily?) locked with different # permissions. We'll just skip it for now. - if self.verbosity: - print( - '\rwarning: `{}` is currently unavailable for ' - 'reading: {}'.format( - p_uni, ex, - ), - file=sys.stderr, - ) + print( + '\rwarning: `{}` is currently unavailable for ' + 'reading: {}'.format( + p_uni, ex, + ), + file=sys.stderr, + ) continue raise # Not expected? https://github.com/ambv/bitrot/issues/