From f81c23cdf52503d028f86a358e5704fe1f903051 Mon Sep 17 00:00:00 2001 From: Adam King Date: Mon, 29 Apr 2002 03:54:50 +0000 Subject: [PATCH] natFileDescriptorWin32.cc (open): Move file pointer to end of file in APPEND mode. 2002-04-29 Adam King * java/io/natFileDescriptorWin32.cc (open): Move file pointer to end of file in APPEND mode. From-SVN: r52869 --- libjava/ChangeLog | 5 +++++ libjava/java/io/natFileDescriptorWin32.cc | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 2cbcf4e166d..b2292770240 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,8 @@ +2002-04-29 Adam King + + * java/io/natFileDescriptorWin32.cc (open): Move file pointer to end + of file in APPEND mode. + 2002-04-25 David S. Miller PR target/6422 diff --git a/libjava/java/io/natFileDescriptorWin32.cc b/libjava/java/io/natFileDescriptorWin32.cc index 694272a67bd..bc9cbc85bc9 100644 --- a/libjava/java/io/natFileDescriptorWin32.cc +++ b/libjava/java/io/natFileDescriptorWin32.cc @@ -124,6 +124,13 @@ java::io::FileDescriptor::open (jstring path, jint jflags) { throw new FileNotFoundException (JvNewStringLatin1 (msg)); } + // For APPEND mode, move the file pointer to the end of the file. + if (jflags & APPEND) + { + DWORD low = SetFilePointer (handle, 0, NULL, FILE_END); + if ((low == 0xffffffff) && (GetLastError () != NO_ERROR)) + throw new FileNotFoundException (JvNewStringLatin1 (winerr ())); + } return (jint)handle; } -- 2.30.2