[PATCH] GetFileAttributesEx not present on Win95

Adam Megacz gcj@lists.megacz.com
Fri Oct 18 16:33:00 GMT 2002


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



More information about the Java-patches mailing list