copy

package
v1.17.0-beta.3 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2026 License: MPL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Chown

func Chown(path string, userName string) error

func ChownR

func ChownR(path string, userName string) error

func CreateIfNotExists

func CreateIfNotExists(dir string, perm os.FileMode) error

func DeniedByFilesystem added in v1.17.0

func DeniedByFilesystem(err error) bool

DeniedByFilesystem reports whether err means the filesystem refused the reassignment (insufficient privilege or a read-only share).

func Directory

func Directory(scrDir, dest string) error

func Exists

func Exists(filePath string) bool

func File

func File(srcFile, dstFile string, perm os.FileMode) error

func IsUID

func IsUID(info os.FileInfo, uid uint32) bool

func Lchown

func Lchown(info os.FileInfo, sourcePath, destPath string) error

func MkdirAllChown added in v1.11.0

func MkdirAllChown(path string, perm os.FileMode, userName string) error

func RenameDirectory

func RenameDirectory(srcDir, dest string) error
func Symlink(source, dest string) error

func Unsupported added in v1.17.0

func Unsupported(error) bool

Unsupported reports whether err means chown itself is not a meaningful operation on this platform (Windows only). On unix, chown is always a real operation, so any failure here is a genuine denial, never this.

Types

type ChownFailure added in v1.17.0

type ChownFailure struct {
	Path string
	Err  error
}

ChownFailure is one entry a recursive chown could not reassign.

func (ChownFailure) Error added in v1.17.0

func (f ChownFailure) Error() string

func (ChownFailure) Unwrap added in v1.17.0

func (f ChownFailure) Unwrap() error

type ChownFailures added in v1.17.0

type ChownFailures []ChownFailure

ChownFailures aggregates the entries ChownR could not chown.

func (ChownFailures) AllDenied added in v1.17.0

func (fs ChownFailures) AllDenied() bool

AllDenied reports whether every failure was refused by the filesystem (permission denied or read-only share); the expected case for entries on virtiofs shares such as read-only .git pack files.

func (ChownFailures) Error added in v1.17.0

func (fs ChownFailures) Error() string

func (ChownFailures) Unwrap added in v1.17.0

func (fs ChownFailures) Unwrap() []error

Jump to

Keyboard shortcuts

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