filesystem

package
v0.1.35 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnsureDirectoryExists

func EnsureDirectoryExists(pathToDirectory string) error

EnsureDirectoryExists ensures that a directory exists at :pathToDirectory, returning an error only if a directory cannot be ensured to exist there

func FindParentContainingChildDirectory

func FindParentContainingChildDirectory(targetDirectoryName, startingFrom string, levels ...int) (string, error)

FindParentContainingChildDirectory continously ascends from the initial directory path at `startingFrom` and checks for the existence of a child directory named `targetDirectoryName` for `levels[0]` levels.

On successfully finding such a child directory, it returns the path of the parent directory as the first argument, on failing to find, it returns an empty string. In both cases, the returned `error`-typed argument will be nil.

If the function failed to complete, the second `error`-typed argument will be non-nil.

func IsDirectoryEmpty

func IsDirectoryEmpty(pathToDirectory string) (bool, error)

IsDirectoryEmpty returns whether the provided directory located at :pathToDirectory is empty or not. If the error return is not nil, this indicates a system-type error

Types

This section is empty.

Jump to

Keyboard shortcuts

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