From 7ce3d70456918c579e18ddbdaf7bf8945bafbaf7 Mon Sep 17 00:00:00 2001 From: Jesse Laprade Date: Wed, 15 Jul 2020 11:50:13 -0400 Subject: [PATCH] added a separate procedure to check program file permissions --- src/rodo.rkt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/rodo.rkt b/src/rodo.rkt index 9376e40..4524ac0 100644 --- a/src/rodo.rkt +++ b/src/rodo.rkt @@ -117,6 +117,9 @@ (close-output-port (open-output-file string))) +(define (has-program-permissions? string) + (equal? program-permissions (file-or-directory-permissions string 'bits))) + ;; ------------------------------------------------ ;; Check conditions ;; ------------------------------------------------ @@ -130,8 +133,7 @@ (begin (displayln-messages-ref 'error-file-doesnt-exist) (exit))] - [(not (equal? program-permissions - (file-or-directory-permissions program-path 'bits))) + [(not (has-program-permissions? program-path)) (displayln-messages-ref 'warning-permissions)] [else 'do-nothing]))