This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: [PATCH] GetFileAttributesEx not present on Win95
- From: Adam Megacz <gcj at lists dot megacz dot com>
- To: Ranjit Mathew <rmathew at hotmail dot com>
- Cc: java-patches at gcc dot gnu dot org, "Fernando Lozano" <fernando at lozano dot eti dot br>
- Date: 18 Oct 2002 16:34:46 -0700
- Subject: Re: [PATCH] GetFileAttributesEx not present on Win95
- Organization: Myself
- References: <3DB01876.5090301@hotmail.com>
Nice find; thanks for noticing this.
Ranjit Mathew <rmathew@hotmail.com> writes:
> - if (! GetFileAttributesEx(buf, GetFileExInfoStandard, &info))
> + HANDLE hFile;
> + if ( ( hFile = CreateFile( buf, GENERIC_READ, FILE_SHARE_READ |
> FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL)) == INVALID_HANDLE_VALUE)
IIRC, CreateFile will fail if another process has locked the file
(which most Win32 apps do, since it's the default). Could we detect
the OS version and use the latter only if it's Win95?
Otherwise this looks fine; can you repost it with this change and with
line-wrapping turned off?
> A simpler alternative was to use the _stat( ) family of
> functions as provided by <sys/stat.h>, but I wanted to
> preserve the "flavour" of the implementation. ;-)
Win32 has a _stat()? I can't find it in Win32.hlp...
- a
--
"Through your rags I see your vanity" -- Socrates