diff src/fileio.c @ 38929:ffa8f910b5f1

2001-08-24 Andrew Choi <akochoi@cse.cuhk.edu.hk> * fileio.c (Ffile_readable_p) [macintosh]: Call access instead of open to determine whether file is readable (as for DOS_NT).
author Andrew Choi <akochoi@shaw.ca>
date Fri, 24 Aug 2001 07:09:01 +0000
parents f77e2401ced1
children 8328e5ca5f55
line wrap: on
line diff
--- a/src/fileio.c	Thu Aug 23 22:17:34 2001 +0000
+++ b/src/fileio.c	Fri Aug 24 07:09:01 2001 +0000
@@ -2967,12 +2967,13 @@
 
   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 @@
     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