Implement FILE-EXECUTABLE?. Tweak logic in FILE-WRITABLE?.
authorChris Hanson <org/chris-hanson/cph>
Fri, 11 Mar 1994 05:19:06 +0000 (05:19 +0000)
committerChris Hanson <org/chris-hanson/cph>
Fri, 11 Mar 1994 05:19:06 +0000 (05:19 +0000)
v7/src/runtime/unxprm.scm

index f137d1db0798f24965893f71579c2b304742a721..c0d577f99ebeee2dde51c216fa9ad600dd183002 100644 (file)
@@ -1,8 +1,8 @@
 #| -*-Scheme-*-
 
-$Id: unxprm.scm,v 1.28 1993/11/29 23:19:02 cph Exp $
+$Id: unxprm.scm,v 1.29 1994/03/11 05:19:06 cph Exp $
 
-Copyright (c) 1988-1993 Massachusetts Institute of Technology
+Copyright (c) 1988-94 Massachusetts Institute of Technology
 
 This material was developed by the Scheme project at the Massachusetts
 Institute of Technology, Department of Electrical Engineering and
@@ -65,13 +65,16 @@ MIT in each case. |#
   (file-access filename 4))
 
 (define (file-writable? filename)
-  (let ((pathname (merge-pathnames filename)))
-    (let ((filename (->namestring pathname)))
-      (or ((ucode-primitive file-access 2) filename 2)
-         (and (not ((ucode-primitive file-exists? 1) filename))
-              ((ucode-primitive file-access 2)
-               (directory-namestring pathname)
-               2))))))
+  ((ucode-primitive file-access 2)
+   (let ((pathname (merge-pathnames filename)))
+     (let ((filename (->namestring pathname)))
+       (if ((ucode-primitive file-exists? 1) filename)
+          filename
+          (directory-namestring pathname))))
+   2))
+
+(define (file-executable? filename)
+  (file-access filename 1))
 
 (define (temporary-file-pathname)
   (let ((root-string