aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVasilij Schneidermann <mail@vasilij.de>2018-01-15 23:06:34 +0100
committerVasilij Schneidermann <mail@vasilij.de>2018-01-15 23:06:34 +0100
commitd05f1ae5a2c9a058323e0524075b5039c3ec1a88 (patch)
tree8d16db863f372e3448fbeb12818b01073a1af47d
parent7d14b6a2aa649e2213348883893a24a6a6083cb9 (diff)
Fix permissions for files *and* directories
-rw-r--r--nov.el8
1 files changed, 4 insertions, 4 deletions
diff --git a/nov.el b/nov.el
index d78cc2b..292c9fc 100644
--- a/nov.el
+++ b/nov.el
@@ -145,18 +145,18 @@ Each alist item consists of the identifier and full path.")
(rename-file item directory))
(delete-directory child))
-(defun nov--fix-permissions (file-or-directory)
+(defun nov--fix-permissions (file-or-directory mode)
(->> (file-modes file-or-directory)
- (file-modes-symbolic-to-number "+r")
+ (file-modes-symbolic-to-number mode)
(set-file-modes file-or-directory)))
(defun nov-fix-permissions (directory)
"Iterate recursively through DIRECTORY to fix its files."
- (nov--fix-permissions directory)
+ (nov--fix-permissions directory "+rx")
(dolist (file (nov-directory-files directory))
(if (file-directory-p file)
(nov-fix-permissions file)
- (nov--fix-permissions file))))
+ (nov--fix-permissions file "+r"))))
(defun nov-unzip-epub (directory filename)
"Extract FILENAME into DIRECTORY.