From fb4c6c961bb0e84d06831a0d9c85d9294d77fe19 Mon Sep 17 00:00:00 2001 From: Andrew Choi Date: Fri, 24 Aug 2001 07:09:01 +0000 Subject: [PATCH] 2001-08-24 Andrew Choi * fileio.c (Ffile_readable_p) [macintosh]: Call access instead of open to determine whether file is readable (as for DOS_NT). --- src/ChangeLog | 7 ++++++- src/fileio.c | 9 +++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 3ea6c330291..18e0ce0b93b 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2001-08-24 Andrew Choi + + * fileio.c (Ffile_readable_p) [macintosh]: Call access instead of + open to determine whether file is readable (as for DOS_NT). + 2001-08-23 Gerd Moellmann * fileio.c (Finsert_file_contents): If VISIT is non-nil, and @@ -282,7 +287,7 @@ * coding.c (setup_coding_system): Don't do any designation based on reg_bits if charset is not yet defined. - * lisp.h (XVECTOR): Verify correct object type before returning a + * lisp.h (XVECTOR): Verify correct object type before returning a pointer, using eassert. 2001-07-17 Gerd Moellmann diff --git a/src/fileio.c b/src/fileio.c index 271cee1a4f0..0b33668ab5d 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -2967,12 +2967,13 @@ See also `file-exists-p' and `file-attributes'.") absname = ENCODE_FILE (absname); -#ifdef DOS_NT - /* Under MS-DOS and Windows, open does not work for directories. */ +#if defined(DOS_NT) || defined(macintosh) + /* Under MS-DOS, Windows, and Macintosh, open does not work for + directories. */ if (access (XSTRING (absname)->data, 0) == 0) return Qt; return Qnil; -#else /* not DOS_NT */ +#else /* not DOS_NT and not macintosh */ flags = O_RDONLY; #if defined (S_ISFIFO) && defined (O_NONBLOCK) /* Opening a fifo without O_NONBLOCK can wait. @@ -2989,7 +2990,7 @@ See also `file-exists-p' and `file-attributes'.") return Qnil; emacs_close (desc); return Qt; -#endif /* not DOS_NT */ +#endif /* not DOS_NT and not macintosh */ } /* Having this before file-symlink-p mysteriously caused it to be forgotten -- 2.39.5