mirror of
https://github.com/gechandesu/runcmd.git
synced 2026-01-02 13:49:34 +03:00
18 lines
198 B
V
18 lines
198 B
V
module runcmd
|
|
|
|
import os
|
|
|
|
struct Pipe {
|
|
pub:
|
|
r int = -1
|
|
w int = -1
|
|
}
|
|
|
|
fn pipe() !Pipe {
|
|
mut fds := [2]int{}
|
|
if C.pipe(&fds[0]) == -1 {
|
|
return os.last_error()
|
|
}
|
|
return Pipe{fds[0], fds[1]}
|
|
}
|