diff options
author | Richard M. Stallman <rms@gnu.org> | 1995-12-31 19:49:39 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 1995-12-31 19:49:39 +0000 |
commit | ace750d05c6d8657468009d07585ba84527dc216 (patch) | |
tree | 7618b4670fa041c76dc5e1f74e2acff38d3c0c6e /src | |
parent | 60cd758e27feec4a01c2a398377b5b15188228db (diff) | |
download | emacs-ace750d05c6d8657468009d07585ba84527dc216.tar.gz |
(Ffile_readable_p) [MSDOS]: Use access rather than open.
Diffstat (limited to 'src')
-rw-r--r-- | src/fileio.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/fileio.c b/src/fileio.c index 33e887cb4c8..921ccf96501 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -2460,11 +2460,19 @@ See also `file-exists-p' and `file-attributes'.") 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 |