Commit e3e8a75a authored by Gerd Moellmann's avatar Gerd Moellmann
Browse files

(Ffile_writable_p) [WINDOWSNT]: Return nil if parent

directory doesn't exist.
parent 59a84f8e
......@@ -2947,8 +2947,17 @@ DEFUN ("file-writable-p", Ffile_writable_p, Sfile_writable_p, 1, 1, 0,
#endif /* MSDOS */
dir = ENCODE_FILE (dir);
#ifdef WINDOWSNT
/* The read-only attribute of the parent directory doesn't affect
whether a file or directory can be created within it. Some day we
should check ACLs though, which do affect this. */
if (stat (XSTRING (dir)->data, &statbuf) < 0)
return Qnil;
return (statbuf.st_mode & S_IFMT) == S_IFDIR ? Qt : Qnil;
#else
return (check_writable (!NILP (dir) ? (char *) XSTRING (dir)->data : "")
? Qt : Qnil);
#endif
}
DEFUN ("access-file", Faccess_file, Saccess_file, 2, 2, 0,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment