osutil

package
v0.0.0-...-e560ebb Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2021 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Overview

Package osutil contains high-level utility functions for operating system functionality.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RunResult

type RunResult struct {
	// Started is true if the process was started successfully.
	Started bool
	Aborted bool
	// ExitStatus only makes sense if Started is true.
	ExitStatus int
}

RunResult contains information about process run via RunWithAbort.

func RunWithAbort

func RunWithAbort(ctx context.Context, cmd *exec.Cmd) (RunResult, error)

RunWithAbort runs an exec.Cmd with context cancellation/aborting. The command will have been waited for when this function returns.

This function returns an error if the command failed to start. This function always returns a valid RunResult, even in case of errors.

Jump to

Keyboard shortcuts

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