cowutils

package
v0.0.0-...-8b65fed Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2025 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotSupported = errors.New("cow is not supported on this OS")
	ErrFailed       = errors.New("cow is not supported on this OS or file")
	ErrTooSmall     = errors.New("file is too smaller then filesystem block size")
)

ErrNotSupported is returned by Always() if the operation is not supported on the current operating system. Auto() will never return this error.

Functions

func DedupeFiles

func DedupeFiles(ctx context.Context, paths []string) (deduped uint64, err error)
func Reflink(ctx context.Context, dst, src *os.File, fallback bool) error

Reflink performs the reflink operation on the passed files, replacing dst's contents with src. If fallback is true and reflink fails, copy_file_range will be used first, and if that fails too io.Copy will be used to copy the data.

func ReflinkRange

func ReflinkRange(ctx context.Context, dst, src *os.File, dstOffset, srcOffset, n int64, fallback bool) error

ReflinkRange performs a range reflink operation on the passed files, replacing part of dst's contents with data from src. If fallback is true and reflink fails, copy_file_range will be used first, and if that fails too io.CopyN will be used to copy the data.

Types

This section is empty.

Jump to

Keyboard shortcuts

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