From ef105b317a979917e139302875355aff48b4ea44 Mon Sep 17 00:00:00 2001 From: glmdev Date: Fri, 30 Nov 2018 17:15:23 -0600 Subject: [PATCH] add symlink resolution for binary files --- do_what.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/do_what.py b/do_what.py index b35c0ef..95e7bbb 100644 --- a/do_what.py +++ b/do_what.py @@ -292,6 +292,8 @@ elif ( (not active and len(sys.argv) == 2) or (active and len(sys.argv) == 3) ): if ( is_binary_file(path) ): filemime = mime.from_file(path) print("echo Binary file: "+filemime) + if ( filemime == "inode/symlink" ): + print("echo Symlink location: "+os.path.realpath(path)) else: trows, tcolumns = os.popen('stty size', 'r').read().split() # if file is taller than the terminal, pipe it to a pretty-print display