Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table plus
applyColStyleToCelltrue
heading0
columnTypess,s,s,s
multiplefalse
columnAttributesstyle="background:#e5e7ea;font-weight:bold,,style="background:#e5e7ea;font-weight:bold,
enableSortingfalse

Syntax

fileRead(fid, len)

Package

file

Alias

Pkg Usage

read(fid, len)

Description

Excerpt
hiddentrue
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
applyColStyleToCelltrue
columnTypess,s,s,s
heading0
multiplefalse
enableSortingfalse

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
languagejs
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)
showLabelsfalse
max25
showSpacefalse
cqllabel = "file_

...

routine" and space = currentSpace ( )
labelsarray_routines