diff options
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, |