copy

package
v25.0.18+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2026 License: Apache-2.0 Imports: 12 Imported by: 167 modules, 257 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DirCopy

func DirCopy(srcDir, dstDir string, copyMode Mode, copyOpaqueXattrs bool) error

DirCopy copies or hardlinks the contents of one directory to another, properly handling soft links, "security.capability" and (optionally) "trusted.overlay.opaque" xattrs.

The copyOpaqueXattrs controls if "trusted.overlay.opaque" xattrs are copied. Passing false disables copying "trusted.overlay.opaque" xattrs.

Types

type Mode

type Mode int

Mode indicates whether to use hardlink or copy content

const (
	// Content creates a new file, and copies the content of the file
	Content Mode = iota
	// Hardlink creates a new hardlink to the existing file
	Hardlink
)

Jump to

Keyboard shortcuts

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