From f97b4d88f0254588d11b8760fc6714828af0ef28 Mon Sep 17 00:00:00 2001 From: jvoisin Date: Sat, 5 Oct 2013 20:46:24 +0100 Subject: mat is now able to check non-writables files This is an implementaion of this suggestion: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=721572 --- MAT/mat.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'MAT/mat.py') diff --git a/MAT/mat.py b/MAT/mat.py index c692a6a..ffe97ea 100644 --- a/MAT/mat.py +++ b/MAT/mat.py @@ -140,10 +140,7 @@ def create_class_file(name, backup, **kwargs): logging.error('%s is is not readable' % name) return None - if not os.access(name, os.W_OK): - #check write permission - logging.error('%s is not writable' % name) - return None + is_writable = os.access(name, os.W_OK) if not os.path.getsize(name): #check if the file is not empty (hachoir crash on empty files) @@ -178,4 +175,4 @@ def create_class_file(name, backup, **kwargs): logging.info('Don\'t have stripper for %s format' % mime) return None - return stripper_class(filename, parser, mime, backup, **kwargs) + return stripper_class(filename, parser, mime, backup, is_writable, **kwargs) -- cgit v1.3