fileutil

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2018 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsFileExist

func IsFileExist(fpath string) bool

IsFileExist reports whether path exits.

func ReplaceFile

func ReplaceFile(src, dest string, mode os.FileMode, logger *logrus.Entry) error

ReplaceFile replaces dest with src.

ReplaceFile just renames (move) the file if possible. If that fails it will read the src file and write the content to the destination file. It returns an error if any.

func SameFile

func SameFile(src, dest string, logger *logrus.Entry) (bool, error)

SameFile reports whether src and dest config files are equal. Two config files are equal when they have the same file contents and Unix permissions. The owner, group, and mode must match. It return false in other cases.

Types

This section is empty.

Jump to

Keyboard shortcuts

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