os

package
v0.0.108 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2021 License: MIT Imports: 5 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ShutdownSignals = []os.Signal{os.Interrupt, syscall.SIGTERM}

Functions

func ChtimesNow added in v0.0.23

func ChtimesNow(name string) error

Chtimes changes the access and modification times of the named file with Now, similar to the Unix utime() or utimes() functions.

The underlying filesystem may truncate or round the values to a less precise time unit. If there is an error, it will be of type *PathError.

func CopyFile added in v0.0.104

func CopyFile(dst string, src string, flag int, perm os.FileMode) error

CopyFile copies from src to dst. Overload os.CopyFile by file path

func CreateAll added in v0.0.23

func CreateAll(path string, perm os.FileMode) error

CreateAll creates or truncates the named file or dir. If the file already exists, it is truncated. If the file does not exist, it is created with mode 0666 (before umask). If the dir does not exist, it is created with mode 0666 (before umask).

func CreateAllIfNotExist added in v0.0.23

func CreateAllIfNotExist(path string, perm os.FileMode) error

CreateAllIfNotExist creates the named file or dir. If the file does not exist, it is created with mode 0666 (before umask). If the dir does not exist, it is created with mode 0666 (before umask). If path is already a directory, CreateAllIfNotExist does nothing and returns nil.

func GetAbsBinDir

func GetAbsBinDir() (dir string, err error)

func PathExists

func PathExists(path string) (bool, error)

func SameFile added in v0.0.104

func SameFile(fi1, fi2 string) bool

SameFile reports whether fi1 and fi2 describe the same file. Overload os.SameFile by file path

func TouchAll added in v0.0.23

func TouchAll(path string, perm os.FileMode) error

TouchAll creates the named file or dir. If the file already exists, it is touched to now. If the file does not exist, it is created with mode 0666 (before umask). If the dir does not exist, it is created with mode 0666 (before umask).

Types

This section is empty.

Jump to

Keyboard shortcuts

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