filesystem

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package filesystem implements some functions and error handling for working with files and directories.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckForExecutable added in v0.7.0

func CheckForExecutable(exe string) (path string, err error)

CheckForExecutable checks if an executable exists in the path.

func CreateDir

func CreateDir(path string) (err error)

CreateDir creates a directory if it does not exist.

func DirExists added in v0.7.0

func DirExists(path string) bool

DirExists returns true if the given path exists and is a directory.

func DownloadFile added in v0.9.0

func DownloadFile(url *url.URL, filePath string) (err error)

DownloadFile downloads a file from a URL.

func RemoveFile added in v0.7.0

func RemoveFile(filePath string) error

RemoveFile removes the given file if it exists.

Types

type ErrDirDoesNotExist added in v0.9.0

type ErrDirDoesNotExist struct {
	DirName string
}

func (ErrDirDoesNotExist) Error added in v0.9.0

func (e ErrDirDoesNotExist) Error() string

type ErrExeNotFound added in v0.9.0

type ErrExeNotFound struct {
	ExeName string
	Path    string
}

func (ErrExeNotFound) Error added in v0.9.0

func (e ErrExeNotFound) Error() string

type ErrFileDoesNotExist added in v0.9.0

type ErrFileDoesNotExist struct {
	FileName string
}

func (ErrFileDoesNotExist) Error added in v0.9.0

func (e ErrFileDoesNotExist) Error() string

type ErrHTTP added in v0.13.0

type ErrHTTP struct {
	URL        *url.URL
	StatusCode int
}

func (ErrHTTP) Error added in v0.13.0

func (e ErrHTTP) Error() string

Jump to

Keyboard shortcuts

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