exec

package
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 8, 2021 License: MIT, MIT Imports: 5 Imported by: 0

README

exec

Package exec runs external commands. It wraps os.exec to allow using full command string as arguments, and provides functions of providing (stdin, stdout, stderr) channel for (stdin, stdout, stderr) pipe.

Attention, this package is experimental.

This package is imported by crun of go edition

Documentation

Overview

Package exec runs external commands. It wraps os.exec to allow using full command string as arguments, and provides functions of providing (stdin, stdout, stderr) channel for (stdin, stdout, stderr) pipe.

Attention, this package is experimental.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cmd

type Cmd struct {
	*exec.Cmd
}

func Command

func Command(name string) (*Cmd, error)

Command returns the Cmd struct to execute the command. No need to split the path and arguments. The error may be caused by unclosed quote.

func (*Cmd) StderrChannel

func (c *Cmd) StderrChannel() (chan string, error)

StderrChannel returns a channel that will be connected to the command's standard error when the command starts. It closes when StderrPipe closed.

func (*Cmd) StdinChannel

func (c *Cmd) StdinChannel() (chan string, error)

StdinChannel returns a channel that will be connected to the command's standard error when the command starts.

func (*Cmd) StdoutChannel

func (c *Cmd) StdoutChannel() (chan string, error)

StdoutChannel returns a channel that will be connected to the command's standard error when the command starts. It closes when StdoutPipe closed.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL