fstools

package module
v0.0.0-...-d0f349b Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2022 License: Apache-2.0 Imports: 20 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CSVtoArray

func CSVtoArray(tagcsv string) []string

func Copy

func Copy(src, dst string) (int64, error)

func DmidecodeProduct

func DmidecodeProduct() (string, error)

func EmptyString

func EmptyString(s string) bool

func Error2ExitCode

func Error2ExitCode(err error) int

func ExecToFile

func ExecToFile(cli string, ofile string) (err error)

func FileExists

func FileExists(filename string) (bool, error)

func GetFirstFile

func GetFirstFile(rootpath string, hint string) string

func GetPrivateSSHKey

func GetPrivateSSHKey() string

func Grep

func Grep(path string, musthave string, mustnothave string) ([]string, error)

was "readlines"

func Gunzip

func Gunzip(dst string, r io.Reader) error

Untar takes a destination path and a reader; a tar reader loops over the tarfile creating the file structure at 'dst' along the way, and writing any files

func Hostname

func Hostname() (string, error)

func MD5sumChunk

func MD5sumChunk(filePath string, chunkSize int64)

work in progress; want to return string of hash for a partial file

func MD5sumFile

func MD5sumFile(filePath string) (string, error)

func Move

func Move(src, dst string) error

func Popen3

func Popen3(output_buffer *bytes.Buffer, stack ...*exec.Cmd) (err error)

formerly Execute

func Popen3Grep

func Popen3Grep(cmd string, musthave string, mustnothave string) ([]string, error)

func Popen3GrepFast

func Popen3GrepFast(cmd string, musthave string, mustnothave string) ([]string, error)

func PopentoString

func PopentoString(cmd string) (string, error)

func PopentoStringAwk

func PopentoStringAwk(cmd string, awk int) (string, error)

func ReadFileToSlice

func ReadFileToSlice(filename string, force bool) ([]string, error)

func SSHPopenToString

func SSHPopenToString(hostname string, command string) (string, error)

func SetPrivateSSHKey

func SetPrivateSSHKey(newkey string)

func SliceContains

func SliceContains(haystack []string, needle string) bool

func Spinny

func Spinny(sigChan chan bool)

func StringToFileOverSSH

func StringToFileOverSSH(outputContent string, remoteserver string, outputfile string) error

write otuput content (including new lines) to file outputfile (including full absolute path) on remoteserver over SSH

func System3

func System3(cmd string) (err error)

func System3AndSpin

func System3AndSpin(cmd string, redirect string) (err error)

func Touch

func Touch(fileName string) error

func TrimSuffix

func TrimSuffix(s, suffix string) string

func Untar

func Untar(dst string, r io.Reader) error

Untar takes a destination path and a reader; a tar reader loops over the tarfile creating the file structure at 'dst' along the way, and writing any files

func Unzip

func Unzip(destination string, r *zip.ReadCloser) error

Untar takes a destination path and a reader; a tar reader loops over the tarfile creating the file structure at 'dst' along the way, and writing any files

func WriteSliceToFile

func WriteSliceToFile(filename string, content []string) error

func WriteStringToFile

func WriteStringToFile(filename string, content string) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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