added a separate procedure to check program file permissions

main
Jesse Laprade 2020-07-15 11:50:13 -04:00
parent 45f41c0d69
commit 7ce3d70456
1 changed files with 4 additions and 2 deletions

View File

@ -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]))