osutils

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: May 7, 2020 License: MIT Imports: 4 Imported by: 12

Documentation

Overview

Package osutils provides additional functionalitly on Golangs `os` package.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrCopyFailed defines the error if copy operation failed.
	ErrCopyFailed = fmt.Errorf("copy failed")
)

Functions

func CopyFile

func CopyFile(src, dest string) error

CopyFile copies a file from source to destination.

func CreateDirectoryIfNotExists added in v0.7.0

func CreateDirectoryIfNotExists(path string, permission ...os.FileMode) (err error)

CreateDirectoryIfNotExists creates a path recursive.

func CreateFileIfNotExists added in v0.7.0

func CreateFileIfNotExists(file string) (err error)

CreateFileIfNotExists creates a file with the given file name (needs to include the path). If path doesn'T exist it returns an error.

func FileOrPathExists

func FileOrPathExists(path string) bool

FileOrPathExists checks if a path or file exists.

Types

This section is empty.

Jump to

Keyboard shortcuts

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