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 ¶
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 ¶
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.