From 963f08a97fa92f5f46193758b84a56286dfb1e04 Mon Sep 17 00:00:00 2001 From: Ranjit Mathew Date: Wed, 23 Oct 2002 20:44:24 +0000 Subject: natFileWin32.cc (attr): Use FindFirstFile( ) instead of GetFileAttributesEx( ) to find file length and... 2002-10-23 Ranjit Mathew * 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. From-SVN: r58466 --- libjava/ChangeLog | 6 ++++++ libjava/java/io/natFileWin32.cc | 9 ++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/libjava/ChangeLog b/libjava/ChangeLog index ec7030bdf3d..1f871dcfac2 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,9 @@ +2002-10-23 Ranjit Mathew + + * 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 * java/net/URL.java diff --git a/libjava/java/io/natFileWin32.cc b/libjava/java/io/natFileWin32.cc index af955016c4f..ebdaeab1d78 100644 --- a/libjava/java/io/natFileWin32.cc +++ b/libjava/java/io/natFileWin32.cc @@ -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 { -- cgit v1.2.1