From 5f501ddb68dd234baf2e26e99df7d9e2defb25d3 Mon Sep 17 00:00:00 2001 From: Vasilij Schneidermann Date: Sun, 10 Sep 2017 00:44:34 +0200 Subject: Make unreadable files readable again --- nov.el | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'nov.el') diff --git a/nov.el b/nov.el index 0e403c1..6f325be 100644 --- a/nov.el +++ b/nov.el @@ -146,6 +146,10 @@ Unnecessary nesting is removed with `nov-unnest-directory'." (defun nov-slurp (filename) "Return the contents of FILENAME." + ;; HACK: unzip preserves file permissions, no matter how silly they + ;; are, so ensure files are readable + (when (not (file-readable-p filename)) + (set-file-modes filename #o444)) (with-temp-buffer (insert-file-contents filename) (buffer-string))) -- cgit v1.2.3