FUNCTION FReadText( ptrHandle AS IntPtr, cBufferVar REF STRING, dwBytes AS DWORD ) AS DWORD
public static uint FReadText( IntPtr ptrHandle, ref string cBufferVar, uint dwBytes )
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(IntPtr)
1DEFINE F_BLOCK := 128 2... 3cBuffer := Space(F_BLOCK) 4ptrHandle := FOpen("temp.txt") 5IF FError() != 0 6 ? DOSErrString(FError()) 7ELSE 8 IF FReadText(ptrHandle, @cBuffer, F_BLOCK) <paramref name="" /> F_BLOCK 9 ? DOSErrString(FError()) 10 ENDIF 11 FClose(ptrHandle) 12ENDIF