Implement (following James Bielman) unix-access for windows.
... use access() not _access(); no, I have no idea why this
makes sense (in either direction).
;;; Rename NAMESTRING to ORIGINAL. First, check whether we have write
;;; access, since we don't want to trash unwritable files even if we
;;; technically can. We return true if we succeed in renaming.
-#!-win32
(defun rename-the-old-one (namestring original)
(unless (sb!unix:unix-access namestring sb!unix:w_ok)
(error "~@<The file ~2I~_~S ~I~_is not writable.~:>" namestring))
;;; w_ok Write permission.
;;; x_ok Execute permission.
;;; f_ok Presence of file.
-#!-win32
+
+;;; In Windows, the MODE argument to access is defined in terms of
+;;; literal magic numbers---there are no constants to grovel. X_OK
+;;; is not defined.
+#!+win32
+(progn
+ (defconstant f_ok 0)
+ (defconstant w_ok 2)
+ (defconstant r_ok 4))
+
(defun unix-access (path mode)
(declare (type unix-pathname path)
(type (mod 8) mode))
GetProcAddress(0, 0);
mkdir(0);
isatty(0);
+ access(0,0)
}
/* EOF */
;;; checkins which aren't released. (And occasionally for internal
;;; versions, especially for internal versions off the main CVS
;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"0.9.8.30"
+"0.9.8.31"