cow

package
v0.0.0-...-a67d04f Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package cow materializes a file as a copy-on-write copy of another.

On filesystems that support block-level reflink (APFS on macOS, btrfs/xfs-with-reflink/bcachefs on Linux) the clone is near-instant and uses zero extra storage until one side diverges. On filesystems that don't support it — ext4, tmpfs, NFS — Clone falls back to a sparse-preserving byte copy.

The primary consumer is machine/oci, which needs every Machine to get its own writable disk without mutating the shared pull cache.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clone

func Clone(src, dst string) error

Clone materializes dst as a copy of src using the fastest path the filesystem supports. If src and dst resolve to the same path, Clone is a no-op. If dst exists, it is replaced.

The parent directory of dst must already exist.

Types

This section is empty.

Jump to

Keyboard shortcuts

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