Skip to content

Latest commit

 

History

History
33 lines (23 loc) · 1 KB

StdPipe.md

File metadata and controls

33 lines (23 loc) · 1 KB

type StdPipe

実行しているプロセスの標準入出力に対応するio.ReadWriteCloser互換のI/Oを提供します。

import

import "github.com/l4go/cmdio"

vendoringして使うことを推奨します。

利用サンプル

example

メソッド概略

func StdDup() (*StdPipe, error)

実行したプロセスの標準入出力をdup()(システムコール)を実行して、成功時には*CmdPipeを返します。 失敗時には、nil以外のerrorの値を返します。

func (self *StdPipe) Read(p []byte) (int, error)

io.Readerと同等の機能を提供します。

func (self *StdPipe) Write(p []byte) (int, error)

io.Writerと同等の機能を提供します。

func (self *StdPipe) Close() error

io.Closerと同等の機能を提供します。

func (self *StdPipe) ReaderClose() error

標準入力側のみCloseします。

func (self *StdPipe) WriterClose() error

標準出力側のみCloseします。