oslib

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

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

Go to latest
Published: Apr 22, 2018 License: MIT Imports: 8 Imported by: 32

README

oslib

Documentation Build Status Report Card

About

Go (golang) package which provides extended operating-system utility functions.

Created by Jay Taylor and used by Gigawatt.

Requirements
  • Go version 1.1 or newer
Running the test suite
go test ./...
License

Permissive MIT license, see the LICENSE file for more information.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	PathSep = quotedPathSep[1 : len(quotedPathSep)-1]
)

Functions

func AttachCmd

func AttachCmd(cmd *exec.Cmd, stdout io.Writer, stderr io.Writer, stdin io.Reader) (*sync.WaitGroup, error)

func BashCmd

func BashCmd(cmdStr string) *exec.Cmd

TODO: Find a way to make this safer/more secure.

func BashCmdf

func BashCmdf(cmdStr string, args ...interface{}) *exec.Cmd

TODO: Find a way to make this safer/more secure.

func ExitStatus

func ExitStatus(err error) (uint32, error)

func IsDirectory

func IsDirectory(path string) (bool, error)

IsDirectory returns a boolean indicating if the provided path is a directory.

func IsRegularFile

func IsRegularFile(path string) (bool, error)

IsRegularFile returns a boolean indicating if the provided path is a regular file.

func OsPath

func OsPath(pathElements ...string) string

OsPath returns a fully assembled path string with appropriate OS-specific separators.

func PathBaseName

func PathBaseName(path string) string

PathBaseName takes a full path and returns the end-most path name - this is the base name! Counter-part of PathDirName.

func PathDirName

func PathDirName(path string) string

PathDirName takes a full path and returns the parent-directory portion of it. Counter-part of PathBaseName.

func PathExists

func PathExists(path string) (bool, error)

PathExists returns whether or not the referenced filesystem path exists.

Types

This section is empty.

Jump to

Keyboard shortcuts

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