Table plus |
---|
applyColStyleToCell | true |
---|
heading | 0 |
---|
columnTypes | s,s,s,s |
---|
multiple | false |
---|
columnAttributes | style="background:#e5e7ea;font-weight:bold,,style="background:#e5e7ea;font-weight:bold, |
---|
enableSorting | false |
---|
|
Syntax | fileRead(fid, len) | Package | file | Alias | | Pkg Usage | read(fid, len) | |
Description
Excerpt |
---|
|
Reads a byte array from a file until it reaches the specified length or until the EOF is reached. |
Reads a byte array from a file until it reaches the specified length or until the EOF is reached.
Parameters
Table plus |
---|
applyColStyleToCell | true |
---|
columnTypes | s,s,s,s |
---|
heading | 0 |
---|
multiple | false |
---|
enableSorting | false |
---|
|
Parameter name | Type | Required | Description |
---|
fid | String | Yes | The id of the open file to read from. | len | Integer | Yes | The | maximal number of bytes that should be read. |
|
Return Type
byte Byte []
Error Handling
Throws
...
stringString
...
- "eof": if you read past the end of the file
- "read_error": " followed by the actual error message if the read fails
"eof"
if you try to read past the EOF
Example
Example 1
Code Block |
---|
|
use "file";
int fid = open("C:\myData.dat");
runnerLog(read(fid, 10));
close(fid); |
Returns: 61|54|32|85|45|33|21|11|40|06 (a byte array)
See also
Filter by label (Content by label) |
---|
showLabels | false |
---|
max | 25 |
---|
showSpace | false |
---|
cql | label = "file_ |
---|
|
...
routine" and space = currentSpace ( ) | labels | array_routines |
---|
|
We've encountered an issue exporting this macro. Please try exporting this page again later.