Front page | perl.perl6.internals |
Postings from July 2002
[patch] win32 io
Thread Next
From:
Daniel Ritz
Date:
July 16, 2002 00:37
Subject:
[patch] win32 io
Message ID:
000d01c22c5d$8bd8ff30$0f64a8c0@local
* win32 can flush it's file buffers (FlushFileBuffers())
* SetFilePointer knows about whence, win32 constants (values, not names) are the same as in linux.
remarks:
FlushFileBuffers doesn't work for console handles, ms help file says:
Windows NT: The function fails if hFile is a handle to console output. That is because console output is not buffered.
The function returns FALSE, and GetLastError returns ERROR_INVALID_HANDLE.
Windows 9x: The function does nothing if hFile is a handle to console output. That is because console output is not buffered.
The function returns TRUE, but it does nothing.
well done microsoft...but it doesn't sound like a big deal. so calling the function should be just fine.
-daniel
Index: io/io_win32.c
===================================================================
RCS file: /cvs/public/parrot/io/io_win32.c,v
retrieving revision 1.18
diff -u -r1.18 io_win32.c
--- io/io_win32.c 8 Jun 2002 03:37:07 -0000 1.18
+++ io/io_win32.c 16 Jul 2002 00:01:31 -0000
@@ -201,7 +201,7 @@
void
PIO_win32_flush(theINTERP, ParrotIOLayer *layer, ParrotIO *io)
{
- /* No op */
+ FlushFileBuffers(io->fd);
}
@@ -268,7 +268,7 @@
offset.LowPart = lo;
offset.HighPart = hi;
p.LowPart = SetFilePointer(io->fd, offset.LowPart,
- &offset.HighPart, FILE_CURRENT);
+ &offset.HighPart, whence);
if (p.LowPart == 0xFFFFFFFF && (GetLastError() != NO_ERROR)) {
/* Error - exception */
return -1;
Thread Next
-
[patch] win32 io
by Daniel Ritz