fsutility

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Regular pathType = 1 << iota
	Symlink
	Directory
	Notexisting
	Unknown
)

Variables

This section is empty.

Functions

func FindEntryDescending

func FindEntryDescending(topSearchPath string, entryName string,
	types pathType) (
	desiredPath string, err error)

FindEntryDescending searches an directory entry from the given topSearchPath and descending to root. It uses pathType as bitwise flags.

func GetFileHash

func GetFileHash(path string) []byte

GetFileHash calculates sha512 with file data. If file doesn't exist then it returns empty slice.

func GetHash

func GetHash(data []byte) []byte

GetHash calculates sha512 from given data

func GetPathType

func GetPathType(path string) pathType

GetPathType returns pathType. If permission denied occur then returns unknown.

func IsLinkPointsToDestination

func IsLinkPointsToDestination(linkPath string, destination string) bool

func MakeDirectoryIfDoesntExist

func MakeDirectoryIfDoesntExist(directory string) error

MakeDirectoryIfDoesntExist creates directory if it doesn't exist. the error is return if unable to create directory.

Types

This section is empty.

Jump to

Keyboard shortcuts

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