natFileDescriptorWin32.cc (open): Move file pointer to end of file in APPEND mode.

2002-04-29  Adam King <aking@dreammechanics.com>

	* java/io/natFileDescriptorWin32.cc (open): Move file pointer to end
	of file in APPEND mode.

From-SVN: r52869
This commit is contained in:
Adam King 2002-04-29 03:54:50 +00:00 committed by Bryce McKinlay
parent 60284a5928
commit f81c23cdf5
2 changed files with 12 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2002-04-29 Adam King <aking@dreammechanics.com>
* java/io/natFileDescriptorWin32.cc (open): Move file pointer to end
of file in APPEND mode.
2002-04-25 David S. Miller <davem@redhat.com>
PR target/6422

View File

@ -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;
}