summaryrefslogtreecommitdiff
path: root/obnamlib/plugins/show_plugin.py
diff options
context:
space:
mode:
authorIan Campbell <ijc@hellion.org.uk>2015-10-03 12:30:40 +0100
committerLars Wirzenius <liw@liw.fi>2015-10-11 14:35:03 +0300
commit4ce858d7c59374fdbbf8ced1308894c7381dc0e6 (patch)
tree8a14ba969014d36bd73ffbe4e73f6e8f217f779f /obnamlib/plugins/show_plugin.py
parent513f55e23e2479f2b37cba54cfb59a39a98fdac3 (diff)
downloadobnam-4ce858d7c59374fdbbf8ced1308894c7381dc0e6.tar.gz
kdirstat: Handled named pipes (fifos)
For some reason this was missing from the mode_str lookup, it is the only type listed on https://github.com/thomas-joiner/k4dirstat/blob/master/kdirstat/cache-file-format.txt which wasn't handled. For unknown file types emit a commented "#UNHANDLED ..." line rather than crashing with a backtrace. Add a yarn for this scenario, although I've not been able to run it due to "ASSUMING extended attributes are allowed for users". Real world use has been tested by Florian Geyer, http://listmaster.pepperfish.net/pipermail/obnam-support-obnam.org/2015-September/003836.html Cc: Florian Geyer <blueice@fobos.de>
Diffstat (limited to 'obnamlib/plugins/show_plugin.py')
-rw-r--r--obnamlib/plugins/show_plugin.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/obnamlib/plugins/show_plugin.py b/obnamlib/plugins/show_plugin.py
index 2e942f03..4b97ea82 100644
--- a/obnamlib/plugins/show_plugin.py
+++ b/obnamlib/plugins/show_plugin.py
@@ -287,8 +287,13 @@ class ShowPlugin(obnamlib.ObnamPlugin):
mode_str = "BlockDev\t"
elif stat.S_ISCHR(mode):
mode_str = "CharDev\t"
+ elif stat.S_ISFIFO(mode):
+ mode_str = "FIFO"
elif stat.S_ISSOCK(mode):
mode_str = "Socket\t"
+ else:
+ # Unhandled, make it look like a comment
+ mode_str = "#UNHANDLED\t"
enc_filename = filename.replace("%", "%25")
enc_filename = enc_filename.replace(" ", "%20")