# HG changeset patch # User Gerd Moellmann # Date 956264476 0 # Node ID 55c84ae4d6344a29aaf39ec23ce3c9898b3368a1 # Parent 4cb794d0027e64580bf9a119af77754457b41aad (Ffile_writable_p) [WINDOWSNT]: Return nil if parent directory doesn't exist. diff -r 4cb794d0027e -r 55c84ae4d634 src/fileio.c --- a/src/fileio.c Thu Apr 20 21:00:43 2000 +0000 +++ b/src/fileio.c Thu Apr 20 21:01:16 2000 +0000 @@ -2947,8 +2947,17 @@ #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,