osutils

package
v0.0.0-...-f4b31ea Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2025 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Abs

func Abs(path string) string

func CreateTmpCopy

func CreateTmpCopy(src string) (string, func(), error)

CreateTmpCopy creates a temporary copy of the given file. It returns the file path, a clean up function, and a potential error.

func DirExists

func DirExists(path string) bool

Verify that a directory exists at the given relative path.

func FindInPathParents

func FindInPathParents(
	pathToFind string,
	startPath string,
	endPath string,
	testFunc func(string) bool) string

Look for a relative path, ascending through parent directories.

Args:

pathToFind: The relative path to look for.
startPath: The path to start the search from.  If |startPath| is a
  directory, it will be included in the directories that are searched.
endPath: The path to stop searching.
testFunc: The function to use to verify the relative path.

func PathExists

func PathExists(path string) bool

Verify that the given relative path exists.

func RecursiveChmod

func RecursiveChmod(root string, mode fs.FileMode) error

RecursiveChmod changes the mode of each file and directory rooted at root, including root.

func ResolveHomeRelPath

func ResolveHomeRelPath(path string) (string, error)

ResolveHomeRelPath resolves any references to the invoker's home directory in the given path.

Types

This section is empty.

Jump to

Keyboard shortcuts

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