This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] GetFileAttributesEx not present on Win95


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]