path

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2025 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateFile

func CreateFile(path string) error

CreateFile Creates the file pointed by the provided path

func CreateFolders

func CreateFolders(path string) error

CreateFolders Creates the folders described in the provided path

func EnsurePresent

func EnsurePresent(directoryPath, filename string) error

EnsurePresent checks if the directory path points to an existing directory, if not, it creates all necessary folders. After that, it checks if the given file exists in the last directory of directoryPath. If not, the file is created as well

func IsExist

func IsExist(path string) bool

IsExist returns true if the path provided points to a currently existing file (or directory)

Types

type FileInfo added in v1.5.1

type FileInfo struct {
	Path string
	Name string
}

func ListAllFiles added in v1.5.1

func ListAllFiles(directoryPath string) ([]FileInfo, error)

ListAllFiles returns a slice of all files contained in directoryPath, recursively checking subdirectories

Jump to

Keyboard shortcuts

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