2002-10-23 Ranjit Mathew <rmathew@hotmail.com>
authormegacz <megacz@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 23 Oct 2002 20:44:24 +0000 (20:44 +0000)
committermegacz <megacz@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 23 Oct 2002 20:44:24 +0000 (20:44 +0000)
        * java/io/natFileWin32.cc (attr): Use FindFirstFile( ) instead of
        GetFileAttributesEx( ) to find file length and modification times,
        as the latter is not present on Windows 95.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@58466 138bc75d-0d04-0410-961f-82ee72b054a4

libjava/ChangeLog
libjava/java/io/natFileWin32.cc

index ec7030b..1f871dc 100644 (file)
@@ -1,3 +1,9 @@
+2002-10-23  Ranjit Mathew <rmathew@hotmail.com>
+
+       * java/io/natFileWin32.cc (attr): Use FindFirstFile( ) instead of
+       GetFileAttributesEx( ) to find file length and modification times,
+       as the latter is not present on Windows 95.
+
 2002-10-21  Michael Koch  <konqueror@gmx.de>
 
        * java/net/URL.java
index af95501..ebdaeab 100644 (file)
@@ -83,10 +83,13 @@ java::io::File::attr (jint query)
 
   JvAssert (query == MODIFIED || query == LENGTH);
 
-  WIN32_FILE_ATTRIBUTE_DATA info;
-  if (! GetFileAttributesEx(buf, GetFileExInfoStandard, &info))
+  WIN32_FIND_DATA info;
+  HANDLE sHandle;
+  if ( ( sHandle = FindFirstFile( buf, &info)) == INVALID_HANDLE_VALUE)
     return 0;
-
+  
+  FindClose( sHandle);
+  
   if (query == LENGTH)
     return ((long long)info.nFileSizeHigh) << 32 | (unsigned long long)info.nFileSizeLow;
   else {