[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
fbRead()
Reads bytes from a binary file
Syntax:
fbRead( nHandle, cBuffer, nBuffer, nRead, ;
cFile, lForze ) -> lExito
nHandle : The file handle from the file.
cBuffer : The buffer where deposite read.
nBuffer : The number of bytes to read.
nRead : Variable that returns the number of read bytes.
cFile : The name of the file.
lForce : Logic value to force to nBuffer will be the same that
nRead.
Description:
Reads nBuffer bytes from the file nHandle depositing the result
on cBuffer. If cBuffer wasn't enough big, the function fill it
with spaces at the end. With cFile we give the File name to the
one that we are accesing if there to show some access error
message. lForce indicates if .T. exists that the reading must be
from nBuffer bytes and doesn't return till nRead will be that
amount. If lForce is .F. returns although nRead will be lower
than nBuffer. Forget the retries cause the same function checks
all of that.
Return:
If there's some error, returns .F. if not returns .T.
Example:
cFile := "Fast.txt"
nHand := fbOpen ( cFich, 0 )
nRead := 0
nBuffer := 100
cBuffer := Space ( nBuffer )
lForce := .F.
If ! fbRead( nHand, cBuffer, nBuffer, @nRead, cFile, lForce )
BoxWarning ( "The reading has been unsuccessful" )
Else
BoxWarning ( "I've read " + Str ( nRead ) + " Bytes" )
EndIf
fbClose ( { nHand } )
See Also:
fbOpen()
fbClose()
fbCreate()
fbWrite()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson