bbutil

package
v0.0.0-...-412af48 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddLinesToFile

func AddLinesToFile(filename string, newlines ...string) error

AddLinesToFile adds lines to the end of a file.

func AddLinesToSortedFile

func AddLinesToSortedFile(filename string, newlines ...string) error

AddLinesToSortedFile adds a line to a sorted file.

func DirExists

func DirExists(path string) (bool, error)

DirExists returns true if directory exists.

func FileExistsOrProblem

func FileExistsOrProblem(path string) bool

FileExistsOrProblem returns true if the file exists or if we can't determine its existence.

func FindDirInParent

func FindDirInParent(target string) (string, error)

FindDirInParent looks for target in CWD, or .., or ../.., etc.

func ReadFileLines

func ReadFileLines(filename string) ([]string, error)

ReadFileLines is like ioutil.ReadFile() but returns an []string.

func RunBash

func RunBash(command string, args ...string) error

RunBash runs a Bash command.

func RunBashInput

func RunBashInput(input string, command string, args ...string) error

RunBashInput runs a Bash command, sends input on stdin.

func RunBashInputOutput

func RunBashInputOutput(input []byte, command string, args ...string) ([]byte, error)

RunBashInputOutput runs a Bash command, sends input on stdin.

func RunBashOutput

func RunBashOutput(command string, args ...string) (string, error)

RunBashOutput runs a Bash command, captures output.

func RunBashOutputSilent

func RunBashOutputSilent(command string, args ...string) (string, error)

RunBashOutputSilent runs a Bash command, captures output, discards stderr.

func ShredFiles

func ShredFiles(names []string) error

ShredFiles securely erases a list of files.

func ShredInfo

func ShredInfo() string

ShredInfo reveals the shred command and flags (for "blackbox info")

func Touch

func Touch(name string) error

Touch updates the timestamp of a file.

Types

This section is empty.

Jump to

Keyboard shortcuts

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