Mercurial > emacs
changeset 13902:31e37f3d8ccd
(Ffile_readable_p) [MSDOS]: Use access rather than open.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Sun, 31 Dec 1995 19:49:39 +0000 |
parents | c9243845a191 |
children | 936c8364e15a |
files | src/fileio.c |
diffstat | 1 files changed, 8 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/fileio.c Sun Dec 31 19:21:18 1995 +0000 +++ b/src/fileio.c Sun Dec 31 19:49:39 1995 +0000 @@ -2460,11 +2460,19 @@ if (!NILP (handler)) return call2 (handler, Qfile_readable_p, abspath); +#ifdef MSDOS + /* Under MS-DOS, open does not work't right, because it doesn't work for + directories (MS-DOS won't let you open a directory). */ + if (access (XSTRING (abspath)->data, 0) == 0) + return Qt; + return Qnil; +#else /* not MSDOS */ desc = open (XSTRING (abspath)->data, O_RDONLY); if (desc < 0) return Qnil; close (desc); return Qt; +#endif /* not MSDOS */ } /* Having this before file-symlink-p mysteriously caused it to be forgotten