gosh

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

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

Go to latest
Published: May 30, 2020 License: MIT Imports: 7 Imported by: 0

README

Gosh

Cross platform file operations in Go

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Chmod

func Chmod(files []string, mode os.FileMode) error

Chmod takes in a slice of files to change modifications on

func Cp

func Cp(source string, destination string) error

Cp copies a source to a destination

func Fex

func Fex(filename string) bool

Fex checks if a file exists. If the file in question is a Directory false is returned. If the file is not a directory and os.Stat was succesful true is returned.

func Ls

func Ls(dirPath string) ([]os.FileInfo, error)

Ls list directory info at the root level

func MkDir

func MkDir(path string) error

MkDir is like mkdir -p

func Mv

func Mv(source string, destionation string) error

Mv moves source to destination

func Rd

func Rd(source string) []byte

Rd returns the contents of a file as bytes. Returns an empty []byte if the file could not be read.

func Rm

func Rm(filePath string) error

Rm removes given file/dir from the filesystem

func RmDir

func RmDir(dirPath string) error

RmDir deletes a Directory with all of it's children

func RmDirChildren

func RmDirChildren(dirPath string) error

RmDirChildren only deletes the children of a directory

func Slash

func Slash() string

Slash returns cross platform (xos) specific slashes for file paths

func Unzip

func Unzip(archive string, destination string) error

Unzip - unzip archive -> destination

func Wr

func Wr(destination string, contents []byte, mode os.FileMode) error

Wr writes a file with given contents and filemode

func Zip

func Zip(source string, target string) error

Zip will zip a given file or directory into a zip file

Types

This section is empty.

Jump to

Keyboard shortcuts

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