lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


In the Lua reference manual (version 3.1) p. 33
* readfrom (filename)

it says under System dependent: if filename starts with | then a piped
input is opened, via function popen.

Could someone illustrate this use of readfrom such that 
a = readfrom("|hello")
will execute the file "hello" and assign the output of "hello" to the
variable a?

(I tried finding the implementation of readfrom in the source files, hoping
to be able to answer this question myself, by searching for "popen", but I
couldn't find the file that contains the implementation.)