fileutils

package
v0.5.6 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2025 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package fileutils provides utility functions for file operations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyFile added in v0.5.0

func CopyFile(srcPath, destPath string) error

CopyFile copies a file from a source to a destination path, preserving the file mode.

func FileExists

func FileExists(path string) (bool, error)

FileExists checks if a file exists at the given path.

func IsDirEmpty

func IsDirEmpty(path string) (bool, error)

IsDirEmpty checks if the specified directory is empty.

func Lrename added in v0.5.0

func Lrename(oldPath, newPath string) error

Lrename renames a file or directory, resolving symlinks in the destination path. If the symlink resolution fails, it returns a SymlinkResolutionError.

func Touch

func Touch(path string) error

Touch creates an empty file at the given path, if it doesn't already exist.

Types

type SymlinkResolutionError added in v0.5.0

type SymlinkResolutionError struct {
	// contains filtered or unexported fields
}

SymlinkResolutionError is the error returned when symlink resolution fails.

func (SymlinkResolutionError) Error added in v0.5.0

func (e SymlinkResolutionError) Error() string

func (SymlinkResolutionError) Is added in v0.5.0

func (e SymlinkResolutionError) Is(target error) bool

Is makes this error insensitive to the internal values.

func (SymlinkResolutionError) Unwrap added in v0.5.0

func (e SymlinkResolutionError) Unwrap() error

Jump to

Keyboard shortcuts

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