mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-02-08 08:43:52 -08:00
(Ffile_readable_p) [MSDOS]: Use access rather than open.
This commit is contained in:
parent
d7e2eff6c1
commit
a8a7d065bd
1 changed files with 8 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue