diff options
| author | Richard M. Stallman | 1995-12-31 19:49:39 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1995-12-31 19:49:39 +0000 |
| commit | a8a7d065bd14a0fa729d76fef3d87a2f7e7c2b14 (patch) | |
| tree | ef50722559ca966641146eb93624c979beb72e61 /src | |
| parent | d7e2eff6c179c5f3eb5bc942e0bd11f851a0a6e3 (diff) | |
| download | emacs-a8a7d065bd14a0fa729d76fef3d87a2f7e7c2b14.tar.gz emacs-a8a7d065bd14a0fa729d76fef3d87a2f7e7c2b14.zip | |
(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'.") | |||
| 2460 | if (!NILP (handler)) | 2460 | if (!NILP (handler)) |
| 2461 | return call2 (handler, Qfile_readable_p, abspath); | 2461 | return call2 (handler, Qfile_readable_p, abspath); |
| 2462 | 2462 | ||
| 2463 | #ifdef MSDOS | ||
| 2464 | /* Under MS-DOS, open does not work't right, because it doesn't work for | ||
| 2465 | directories (MS-DOS won't let you open a directory). */ | ||
| 2466 | if (access (XSTRING (abspath)->data, 0) == 0) | ||
| 2467 | return Qt; | ||
| 2468 | return Qnil; | ||
| 2469 | #else /* not MSDOS */ | ||
| 2463 | desc = open (XSTRING (abspath)->data, O_RDONLY); | 2470 | desc = open (XSTRING (abspath)->data, O_RDONLY); |
| 2464 | if (desc < 0) | 2471 | if (desc < 0) |
| 2465 | return Qnil; | 2472 | return Qnil; |
| 2466 | close (desc); | 2473 | close (desc); |
| 2467 | return Qt; | 2474 | return Qt; |
| 2475 | #endif /* not MSDOS */ | ||
| 2468 | } | 2476 | } |
| 2469 | 2477 | ||
| 2470 | /* Having this before file-symlink-p mysteriously caused it to be forgotten | 2478 | /* Having this before file-symlink-p mysteriously caused it to be forgotten |