This is the mail archive of the
cygwin-developers@sourceware.cygnus.com
mailing list for the Cygwin project.
Re: stat() behavior differs on Win9x and WinNT
- To: "Fifer, Eric" <EFifer at sanwaint dot com>
- Subject: Re: stat() behavior differs on Win9x and WinNT
- From: Corinna Vinschen <corinna at vinschen dot de>
- Date: Mon, 08 May 2000 11:51:53 +0200
- CC: cygwin-developers at sourceware dot cygnus dot com
- Organization: Cygnus Solutions, a Red Hat Company
- References: <779F20BCCE5AD31186A50008C75D997917171E@silldn_mail1.sanwaint.com>
- Reply-To: cygwin-developers at sourceware dot cygnus dot com
"Fifer, Eric" wrote:
>
> With recent snapshots, stat() of a file with an invalid name,
> like stat("abc>def") ('>' is not allowed in file names), does
> not fail on Win98:
> [...]
> Win98:
> symlink_info::check: GetFileAttributesA (c:\efifer\opt\abc>def) failed
> seterrno: 161 (BAD_PATHNAME) -> 22
> [...]
>
> WinNT:
> symlink_info::check: GetFileAttributesA (c:\efifer\opt\abc>def) failed
> seterrno: 123 (INVALID_NAME) -> 2
>
> A patch is trival, but I'm not sure which is correct:
>
> + map BAD_PATHNAME to ENOENT (instead of the current EINVAL), but
> I have no idea how widespread the impact of this might be. Or,
> maybe INVALID_NAME should really be EINVAL?
>
> + change the test in stat_worker to:
>
> (!oret && get_errno () != ENOENT && get_errno () != EINVAL)
IMO the mapping ERROR_BAD_PATHNAME -> EINVAL is incorrect.
Corinna