Types

Pipe

Wrapper around file descriptors returned by PIPE(2)

Methods

child_fd(p:Pipe)
Get child process end file descriptor of Pipe. It's the writing end for Pipe(STDLIB_CHILD_TO_PARENT_PIPE_DIR).
child_fd(p:Pipe)
Get child process end file descriptor of Pipe. It's the reading end for Pipe(STDLIB_PARENT_TO_CHILD_PIPE_DIR).
close_reading_end(p:Pipe)
Close reading end of the Pipe
close_writing_end(p:Pipe)
Close writing end of the Pipe
dup2_reading_end(p:Pipe, newfd:Int)
DUP2(2) reading file descriptor
dup2_writing_end(p:Pipe, newfd:Int)
DUP2(2) writing file descriptor
init(pipe:Pipe)
Pipe constructor. Create UNIX pipe using PIPE(2). Throws PipeCreateFail if pipe can not be created.
init(pipe:Pipe, direction:Int)
Pipe constructor. Create UNIX pipe using PIPE(2). Throws PipeCreateFail if pipe can not be created.
parent_fd(p:Pipe)
Get parent process end file descriptor of Pipe. It's the reading end for Pipe(STDLIB_CHILD_TO_PARENT_PIPE_DIR).
parent_fd(p:Pipe)
Get parent process end file descriptor of Pipe. It's the writing end for Pipe(STDLIB_PARENT_TO_CHILD_PIPE_DIR).
read(p:Pipe)
Read from Pipe without parsing. TODO: document if it throws.
Str(p:Pipe)
write(s:Str, p:Pipe)
Write to Pipe. TODO: document if it throws.