read multimethod

Methods

read(fd:Int, count:Any=null) Source: stdlib.ngs:5563
Read all data from a file referenced by file descriptor without parsing it.

Parameters

fdFile descriptor to read from

Returns

Str

Example

read(0)  # All data from stdin
read() Source: stdlib.ngs:5590
Read all data from a file referenced by file descriptor 0 (stdin) without parsing it. Same as read(0)
read(p:Pipe, count:Any=null) Source: stdlib.ngs:5732
Read from Pipe without parsing. TODO: document if it throws.

Returns

read data

Example

data = read(myipe)
read(pp:ProcessesPipeline, count:Any=null) Source: stdlib.ngs:6490
Read from last process of ProcessesPipeline

Example

p = $(seq 3 | tac |);
data = read(p);
p.close()
read(fname:Str) Source: stdlib.ngs:7897
Read whole file
read(f:File) Source: stdlib.ngs:7903
Read whole file
read(f:MaybeFile, dflt:Any=null)
Reads the whole file using previously defined read()

Returns

Like read(File) or dflt if the file is not present.
read(t:Terminal, count:Int=1)
Undocumented