filesystem

package
v0.0.0-...-d8bc51a Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package filesystem implements things like moving files, copying them, etc.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrEmptyPath       = errors.New("provided path is empty")                      // ErrEmptyPath is returned when function is called with empty path parameter
	ErrPathIsDirectory = fmt.Errorf("provided path is directory: %w", os.ErrExist) // ErrPathIsDirectory is returned when path exists, but is a directory and not a file
	ErrFileNotRegular  = errors.New("file is not regular file")                    // ErrFileNotRegular is returned when path exists, but is not a regular file
)

Functions

func CheckFileExists

func CheckFileExists(path string) error

CheckFileExists checks if file exists at PATH

func CopyDir

func CopyDir(pathSource, pathDestination string) error

CopyDir copies directory recursively from SOURCE to DESTINATION

func CopyFile

func CopyFile(pathSource, pathDestination string) error

CopyFile copies file from SOURCE to DESTINATION

func DirTree

func DirTree(root string) ([]string, error)

DirTree is equivalent to "tree" command

func MoveFile

func MoveFile(pathSource, pathDestination string) error

MoveFile moves file from SOURCE to DESTINATION

Types

This section is empty.

Jump to

Keyboard shortcuts

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