fileRead
|
The fileRead function reads data from a file {fileID} into the
specified ByteVector Object {bytevector}. The ByteVector Object is always
returned. If no ByteVector Object is specified, one will be created to hold the
data that is read from the file.
Data is entered into a file with the fileWrite, fwriteln, or fdisplay
functions, however, records are not actually committed to the file until the file
is closed. Thus, attempting to read a record immediately after a fileWrite or
fdisplay will result in an error. In order to verify records that have been
written, it is necessary to close the file and save the file (fileClose
with an option argument equal to 1) . The file can then be re-opened and read
with the fileRead function.
Usage The fileRead function is used to read data from an existing file
(One that have been previously closed and saved file. See the fileClose
function with an option argument equal to 1).
(fileRead fileID offset length bytevector) (fileRead fileID pointer length) (fileRead fileID length) The ByteVector resulting from the file read is always returned as the value of this
function.
Expression:
Arguments
Name
Type
Description Argument: fileID Integer
An Integer representing the fileID of the file returned from a previous
fileOpen function. Argument: offset Integer
Optional. The integer index into the specified ByteVector where the
data stream is to start . If no offset is specified, the offset defaults to zero. Argument: length Integer
Optional. The integer length of data which is to be read into the specified
ByteVector. If no length is specified, the length defaults to the length to the
end of the file. Argument: bytevector ByteVector
Optional. The ByteVector into which the data is to be placed. If no ByteVector
is specified, one will be created. Argument: pointer ByteVector
Optional. The pointer where the data is to be placed.
Returns:
Here are a number of links to Lambda coding examples which contain this instruction in various use cases.
Here are the links to the data types of the function arguments.
ByteVector | Text | Integer | Boolean |
Here are also a number of links to functions having arguments with any of these data types.
Analytic Information Server (AIS)AIS Component Systems
|