[Message Prev][Message Next][Thread Prev][Thread Next][Message Index][Thread Index]
[MD:1763] Bug fix of file-readable-p
- X-ml-count: 1763
- Subject: [MD:1763] Bug fix of file-readable-p
- From: Eli Zaretskii <eliz@xxxxxxxxxxxxx>
- Date: Mon, 17 Apr 2000 20:08:07 +0900
On Mon, 17 Apr 2000, Shun-ichi GOTO wrote:
Thanks for your bug report and the patch.
However, I wonder about one aspect of this patch:
+ #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;
IIRC, `stat' fails (returns -1) on Windows for root directories. If I'm
right, this means that file-writable-p, as you suggest to patch it, will
return nil for any file in the root directory of any drive.
The test cases you included didn't check this case. Could you please
check that, both on Wndows NT and Windows 9X (if you have access to it)
and see if this problem indeed exists?