Documentation
¶
Index ¶
- Variables
- func List2cmdline(seq []string) string
- func NtCommandLineModule(cmdline string, s NtSearch, isFile func(string) bool) (string, bool)
- func NtShell(args string, getenv func(string) string) (string, string, error)
- func Returncode(e *exec.ExitError) int
- func Run(argv []string, timeoutSeconds int, check bool) (stdout, stderr []byte, err error)
- func ShellCommand(command string) (*exec.Cmd, error)
- func UnixShell() string
- type CalledProcessError
- type Completed
- type NtSearch
- type Options
- type TimeoutExpired
Constants ¶
This section is empty.
Variables ¶
var ErrNtShellNotFound = errors.New("shell not found: neither %ComSpec% nor %SystemRoot% is set")
ErrNtShellNotFound is the FileNotFoundError Popen raises when neither ComSpec nor SystemRoot names a shell
Functions ¶
func List2cmdline ¶
Windows command line of the argument sequence with the MS C runtime quoting subprocess uses
func NtCommandLineModule ¶
Module CreateProcess starts for a command line without an application name, false when no candidate exists
func NtShell ¶
Executable and command line Popen hands CreateProcess for shell=True, an empty executable leaving CreateProcess to search
func Returncode ¶
Popen returncode of an exited child, negative for a signal on POSIX
func Run ¶
Runs argv with captured output and a whole second timeout, failing like check=True on a nonzero exit
func ShellCommand ¶
Command Popen runs for shell=True, the string handed to /bin/sh -c or the Android system shell
Types ¶
type CalledProcessError ¶
Failure subprocess.run raises with check=True when the command exits nonzero
func (*CalledProcessError) Error ¶
func (e *CalledProcessError) Error() string
type NtSearch ¶
type NtSearch struct {
AppDir string
Cwd string
SkipCwd bool
SystemDir string
WindowsDir string
Path string
}
Search places CreateProcess walks for a module named without a directory
type Options ¶
type Options struct {
Dir string
Env []string
Input []byte
Timeout time.Duration
Check bool
Attr *syscall.SysProcAttr
}
Keywords of one subprocess.run call with capture_output, nil Env inherits and nil Input reads the null device
type TimeoutExpired ¶
type TimeoutExpired struct {
Cmd []string
Timeout int
TimeoutFloat *float64
Stdout []byte
Stderr []byte
}
Failure subprocess.run raises after killing a command that outlived its timeout
func (*TimeoutExpired) Error ¶
func (e *TimeoutExpired) Error() string
Message with the timeout printed as Python prints the int or the float the caller passed