Function; readfrom - HWRM/KarosGraveyard GitHub Wiki

readfrom([<sFilename>])

Description

(from LUA 4 Manual: 6.4 I/O Facilities)

"This function may be called in two ways. When called with a file name, it opens the named file, sets its handle as the value of _INPUT, and returns this value. It does not close the current input file. When called without parameters, it closes the _INPUT file, and restores stdin as the value of _INPUT. If this function fails, it returns nil, plus a string describing the error.
If filename starts with a |, then a piped input is opened, via function popen. Not all systems implement pipes. Moreover, the number of files that can be open at the same time is usually limited and depends on the system."

Example

Arguments

<sFilename>: the name of the file to read from. Closes the _INPUT file, and restores stdin as the value of _INPUT if omitted.

Related Functions

Function Reference

popen

LUA 4 Manual: 6.4 I/O Facilities

Comments

Page Status

Updated Formatting? Initial
Updated for HWRM? Initial

⚠️ **GitHub.com Fallback** ⚠️