From 6c786e7a88db0eb7bcfae4afd35ec7aad6682ecb Mon Sep 17 00:00:00 2001 From: Christophe Rhodes Date: Tue, 10 Jan 2006 17:39:28 +0000 Subject: [PATCH] 0.9.8.31: Implement (following James Bielman) unix-access for windows. ... use access() not _access(); no, I have no idea why this makes sense (in either direction). --- src/code/fd-stream.lisp | 1 - src/code/unix.lisp | 11 ++++++++++- src/runtime/win32-os.c | 1 + version.lisp-expr | 2 +- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/code/fd-stream.lisp b/src/code/fd-stream.lisp index 0e43da7..90621d9 100644 --- a/src/code/fd-stream.lisp +++ b/src/code/fd-stream.lisp @@ -1879,7 +1879,6 @@ ;;; 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 "~@" namestring)) diff --git a/src/code/unix.lisp b/src/code/unix.lisp index 2423d6c..f4d0ef3 100644 --- a/src/code/unix.lisp +++ b/src/code/unix.lisp @@ -239,7 +239,16 @@ SYSCALL-FORM. Repeat evaluation of SYSCALL-FORM if it is interrupted." ;;; 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)) diff --git a/src/runtime/win32-os.c b/src/runtime/win32-os.c index 475132e..c1bf6a2 100644 --- a/src/runtime/win32-os.c +++ b/src/runtime/win32-os.c @@ -600,6 +600,7 @@ void scratch(void) GetProcAddress(0, 0); mkdir(0); isatty(0); + access(0,0) } /* EOF */ diff --git a/version.lisp-expr b/version.lisp-expr index 5e71226..5dd763c 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -17,4 +17,4 @@ ;;; 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" -- 1.7.10.4