reflinktree

package
v1.14.0 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2026 License: GPL-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package reflinktree provides utilities for creating reflink (copy-on-write) trees that mirror torrent file layouts for cross-seeding.

Reflinks create copy-on-write clones of files, allowing safe modification of the cloned files without affecting the originals. This is ideal for cross-seeding scenarios where qBittorrent may need to download/repair bytes that would otherwise risk corrupting the original seeded files.

Index

Constants

This section is empty.

Variables

View Source
var ErrReflinkUnsupported = errors.New("reflink not supported on this platform or filesystem")

ErrReflinkUnsupported is returned when reflink operations are not supported on the current platform or filesystem.

Functions

func Create

func Create(plan *hardlinktree.TreePlan) error

Create materializes a reflink tree plan on disk. Creates necessary directories and reflinks files from source to target paths. On failure, attempts best-effort rollback of created files.

Returns nil if all reflinks were created successfully. Returns an error if any reflink creation fails (after attempting rollback).

func Rollback

func Rollback(plan *hardlinktree.TreePlan) error

Rollback removes created files and directories from a failed plan execution. Best-effort: continues even if some removals fail.

func SupportsReflink(dir string) (supported bool, reason string)

SupportsReflink tests whether the given directory supports reflinks by attempting an actual clone operation with temporary files. Returns true if reflinks are supported, along with a reason string.

Types

This section is empty.

Jump to

Keyboard shortcuts

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