diff options
| author | Gerd Moellmann | 2000-04-20 21:01:16 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2000-04-20 21:01:16 +0000 |
| commit | e3e8a75a2a6f9cfad433acee32cba30bc2449a8f (patch) | |
| tree | 2ca06295184057aa746b9c4ceb3d0e89e1b11497 /src | |
| parent | 59a84f8e16e2251e56e86d261f24cd209ded2946 (diff) | |
| download | emacs-e3e8a75a2a6f9cfad433acee32cba30bc2449a8f.tar.gz emacs-e3e8a75a2a6f9cfad433acee32cba30bc2449a8f.zip | |
(Ffile_writable_p) [WINDOWSNT]: Return nil if parent
directory doesn't exist.
Diffstat (limited to 'src')
| -rw-r--r-- | src/fileio.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/fileio.c b/src/fileio.c index 545061ba0d1..59d09a93157 100644 --- a/src/fileio.c +++ b/src/fileio.c | |||
| @@ -2947,8 +2947,17 @@ DEFUN ("file-writable-p", Ffile_writable_p, Sfile_writable_p, 1, 1, 0, | |||
| 2947 | #endif /* MSDOS */ | 2947 | #endif /* MSDOS */ |
| 2948 | 2948 | ||
| 2949 | dir = ENCODE_FILE (dir); | 2949 | dir = ENCODE_FILE (dir); |
| 2950 | #ifdef WINDOWSNT | ||
| 2951 | /* The read-only attribute of the parent directory doesn't affect | ||
| 2952 | whether a file or directory can be created within it. Some day we | ||
| 2953 | should check ACLs though, which do affect this. */ | ||
| 2954 | if (stat (XSTRING (dir)->data, &statbuf) < 0) | ||
| 2955 | return Qnil; | ||
| 2956 | return (statbuf.st_mode & S_IFMT) == S_IFDIR ? Qt : Qnil; | ||
| 2957 | #else | ||
| 2950 | return (check_writable (!NILP (dir) ? (char *) XSTRING (dir)->data : "") | 2958 | return (check_writable (!NILP (dir) ? (char *) XSTRING (dir)->data : "") |
| 2951 | ? Qt : Qnil); | 2959 | ? Qt : Qnil); |
| 2960 | #endif | ||
| 2952 | } | 2961 | } |
| 2953 | 2962 | ||
| 2954 | DEFUN ("access-file", Faccess_file, Saccess_file, 2, 2, 0, | 2963 | DEFUN ("access-file", Faccess_file, Saccess_file, 2, 2, 0, |