|
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.
When to use 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.
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. Here are also a number of links to functions having arguments with any of these data types.
You can always talk with the AIS at aiserver.sourceforge.net.
Name
Description
AIS Types fileID An Integer representing the fileID of the file returned from a previous
fileOpen function. Integer offset 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. Integer length 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. Integer bytevector Optional. The ByteVector into which the data is to be placed. If no ByteVector
is specified, one will be created. ByteVector pointer Optional. The pointer where the data is to be placed. ByteVector
Returns:
Examples
Argument Types
ByteVector
Text
Integer
Boolean
How do I contact the AIS team?