diff options
author | Ranjit Mathew <rmathew@hotmail.com> | 2002-10-23 20:44:24 +0000 |
---|---|---|
committer | Adam Megacz <megacz@gcc.gnu.org> | 2002-10-23 20:44:24 +0000 |
commit | 963f08a97fa92f5f46193758b84a56286dfb1e04 (patch) | |
tree | 86dc75353f4f9538f44fc202b821288a8185f6d7 | |
parent | e6f052b7e6e0d3969b9e3b1357980e00403d62cc (diff) | |
download | gcc-963f08a97fa92f5f46193758b84a56286dfb1e04.tar.gz |
natFileWin32.cc (attr): Use FindFirstFile( ) instead of GetFileAttributesEx( ) to find file length and...
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.
From-SVN: r58466
-rw-r--r-- | libjava/ChangeLog | 6 | ||||
-rw-r--r-- | 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 <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 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 { |