fileops

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2026 License: GPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckPermissions added in v1.0.2

func CheckPermissions(path string, perm Permission) error

CheckPermissions validates if the current user has the required permissions

func CopyFileOrDir

func CopyFileOrDir(src, dst string) error

CopyFileOrDir copies a file or directory from src to dst

func CopyMultiple

func CopyMultiple(sources []string, destDir string) error

CopyMultiple copies multiple files/directories to a destination directory

func CreateDir

func CreateDir(dir, name string) error

CreateDir creates a new directory

func CreateFile

func CreateFile(dir, name string) error

CreateFile creates a new empty file

func Delete

func Delete(path string, isDir bool) error

Delete deletes a file or directory (tries trash first, then permanent delete)

func DeleteWithUndo added in v1.0.2

func DeleteWithUndo(path string, isDir bool) (string, error)

DeleteWithUndo deletes a file or directory and returns the trash path for undo Returns (trashPath, error)

func FormatError added in v1.0.2

func FormatError(err error, path string, operation string) error

FormatError formats an error with helpful context and suggestions

func MoveMultiple

func MoveMultiple(sources []string, destDir string) error

MoveMultiple moves multiple files/directories to a destination directory

func MoveToTrash

func MoveToTrash(path string) error

MoveToTrash moves a file or directory to the system trash/recycle bin

func Rename

func Rename(oldPath, newName string) error

Rename renames a file or directory

func RestoreFromTrash added in v1.0.2

func RestoreFromTrash(undoInfoPath, originalPath string) error

RestoreFromTrash attempts to restore a file from trash

Types

type Permission added in v1.0.2

type Permission int

Permission type for validation

const (
	PermRead Permission = iota
	PermWrite
	PermExecute
)

Jump to

Keyboard shortcuts

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