ioutils

package
v0.0.0-...-3a64f8a Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2016 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendToFd

func AppendToFd(fd *os.File, strToAdd, patToCheck string) error

func CmdPipe

func CmdPipe(cmd1bin, cmd1args, cmd2bin, cmd2args string) error

func CopyDir

func CopyDir(srcDir, dstDir string) error

Copy a directory(not portable function due to the "cp" usage)

func CopyFile

func CopyFile(srcFile, dstFile string, dstFilePermissions os.FileMode,
	dstFileOwner, dstFileGroup int, removeOriginal bool) error

copyFile copies a file. Returns amount of written bytes and error

func CreateDirRecursively

func CreateDirRecursively(dirToCreate string, permissions os.FileMode,
	owner, group int, backupOriginal bool) error

CreateDirRecursively gets path to directories tree , permissions , UID and GID and a boolean value telling whether we should backup existing tree in case of necessity Creates the whole tree Returns error or nil

func FindAndReplace

func FindAndReplace(srcFile, dstFile, oldPattern, newPattern string,
	filePermissions os.FileMode) error

FindAndReplace is looking for appropriate pattern in the file and replace it with a new one Could be also applied for generating a new file

func FindAndReplaceFd

func FindAndReplaceFd(fd *os.File, oldPattern, newPattern string) error

func FindAndReplaceMulti

func FindAndReplaceMulti(srcFile, dstFile string, patternMap map[string]string,
	filePermissions os.FileMode) error

FindAndReplaceMulti is looking for appropriate patterns in the file and replace them with new patterns The patterns must be represented as a map where key is the old pattern and value is a new one Could be also applied for generating a new file

func MyCopy

func MyCopy(src, dst string, dstFilePermissions os.FileMode,
	dstFileOwner, dstFileGroup int, removeOriginal bool) error

func PatternFound

func PatternFound(file, pattern string) bool

PatternFound

func RemoveIfExists

func RemoveIfExists(handleError bool, paths ...string) error

RemoveIfExists cleans up appropriate stuff It gets a single path or multiple paths and boolean value telling if an error shall be thrown Returns error or nil

func WriteToFile

func WriteToFile(pathToFile string, opt int, data 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