FFlush Function (IntPtr)
FUNCTION FFlush( ptrHandle AS IntPtr ) AS LOGIC
public static bool FFlush( IntPtr ptrHandle )
The low level File IO functions in the X# runtime are using .Net filestreams in the background. |
That means that the file handles returned by FOpen() and FCreate() are not 'normal' file handles, but unique identifiers that are used to find the underlying stream object in a collection of streams in the runtime.
That also means that you can't use file handles for functions such as FRead() and FWrite() that were not created in the X# runtime.
If you want to access the underlying FileStream, then you should call the function FGetStream()
1ptrHandle := FOpen2("docs.txt", ; 2 FO_READWRITE + FO_SHARED) 3IF ptrHandle != F_ERROR 4 FWrite(ptrHandle, Space(100)) 5 nKey := Inkey(50) 6 FFlush(ptrHandle) // Save data 7ENDIF