osutil: github.com/tredoe/osutil Index | Files | Directories

package osutil

import "github.com/tredoe/osutil"


Package Files



var ErrNoRoot = errors.New("MUST have administrator privileges")

func Exec Uses

func Exec(cmd string, args ...string) error

Exec executes a command setting both standard input, output and error.

func ExecSudo Uses

func ExecSudo(cmd string, args ...string) error

ExecSudo executes a command under "sudo".

func MustbeRoot Uses

func MustbeRoot() error

MustbeRoot returns an error message if the user is not root.

func Sudo Uses

func Sudo() error

Sudo executes command "sudo". If some command needs to use "sudo", then could be used this function at the beginning so there is not to wait until that it been requested later.


config/envPackage env implements the setting of persistent environment variables.
config/shconfPackage shconf implements a parser and scanner for the configuration in format shell-variable.
distroPackage distro detects the Linux distribution.
filePackage file handles common operations in files.
pkgutilPackage pkgutil handles basic operations in the management of packages in operating systems.
shPackage sh interprets a command line just like it is done in the Bash shell.
userPackage user provides access to UNIX users database in local files.
user/cryptPackage crypt provides interface for password crypt functions and collects common constants.
user/crypt/apr1_cryptPackage apr1_crypt implements the standard Unix MD5-crypt algorithm created by Poul-Henning Kamp for FreeBSD, and modified by the Apache project.
user/crypt/commonPackage common contains routines used by multiple password hashing algorithms.
user/crypt/md5_cryptPackage md5_crypt implements the standard Unix MD5-crypt algorithm created by Poul-Henning Kamp for FreeBSD.
user/crypt/sha256_cryptPackage sha256_crypt implements Ulrich Drepper's SHA256-crypt password hashing algorithm.
user/crypt/sha512_cryptPackage sha512_crypt implements Ulrich Drepper's SHA512-crypt password hashing algorithm.

Package osutil imports 3 packages (graph) and is imported by 2 packages. Updated 2017-08-28. Refresh now. Tools for package owners.