ExternalStream.st
changeset 11651 a2f6ca848f35
parent 11650 fa89c9845022
child 11751 1e75c54748ef
--- a/ExternalStream.st	Wed Mar 18 14:57:36 2009 +0100
+++ b/ExternalStream.st	Wed Mar 18 17:30:23 2009 +0100
@@ -3104,14 +3104,14 @@
 
     __INST(lastErrorNumber) = nil;
     if ((fp = __INST(filePointer)) != nil) {
+        f = __FILEVal(fp);
 #ifdef WIN32
         __threadErrno = 0;
-        ret = __STX_API_NOINT_CALL1( "FlushFileBuffers", FlushFileBuffers, fp);
+        ret = __STX_API_NOINT_CALL1( "FlushFileBuffers", FlushFileBuffers, _get_osfhandle(fileno(f)));
         if (ret) {
             RETURN (self);
         }
 #else
-        f = __FILEVal(fp);
 
         __BEGIN_INTERRUPTABLE__
         do {
@@ -3132,7 +3132,9 @@
     filePointer isNil ifTrue:[^ self errorNotOpen].
 
     "
-     the system does not support sync (VMS)
+        |f|
+        f := 'x' asFilename writeStream.
+        f nextPutAll:'hallo'; sync; syncData; close
     "
 !
 
@@ -3150,14 +3152,14 @@
 
     __INST(lastErrorNumber) = nil;
     if ((fp = __INST(filePointer)) != nil) {
+        f = __FILEVal(fp);
 #ifdef WIN32
         __threadErrno = 0;
-        ret = __STX_API_NOINT_CALL1( "FlushFileBuffers", FlushFileBuffers, fp);
+        ret = __STX_API_NOINT_CALL1( "FlushFileBuffers", FlushFileBuffers, _get_osfhandle(fileno(f)));
         if (ret) {
             RETURN (self);
         }
 #else
-        f = __FILEVal(fp);
 
         __BEGIN_INTERRUPTABLE__
         do {
@@ -3176,6 +3178,12 @@
 %}.
     lastErrorNumber notNil ifTrue:[^ self ioError].
     filePointer isNil ifTrue:[^ self errorNotOpen].
+
+    "
+        |f|
+        f := 'x' asFilename writeStream.
+        f nextPutAll:'hallo'; sync; syncData; close
+    "
 !
 
 truncateTo:newSize
@@ -6087,7 +6095,7 @@
 !ExternalStream class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/ExternalStream.st,v 1.320 2009-03-18 13:57:36 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/ExternalStream.st,v 1.321 2009-03-18 16:30:23 stefan Exp $'
 ! !
 
 ExternalStream initialize!