fsutil

package
v1.0.0-alpha.6 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2026 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

Package fsutil holds the small filesystem helpers shared by the agents (tree copies for spooling and migration) and by the job specs (archive entry names). It only uses the standard library and executes nothing, so server-side packages may import it too.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyFile

func CopyFile(src, dst string) error

CopyFile copies one regular file (creating the parent directory), keeping its mode, modification time and ownership (best effort)

func CopyMissing

func CopyMissing(src, dst string) (int, error)

CopyMissing is CopyTree for the files that do not exist below dst yet; it returns how many files it copied.

func CopyTree

func CopyTree(src, dst string) error

CopyTree copies src into dst recursively, keeping modes, modification times, ownership (best effort, needs root) and symlinks; existing files are overwritten. Devices, sockets and fifos are skipped.

func FlattenPath

func FlattenPath(p string) string

FlattenPath turns an absolute path into a single name usable as an archive entry (`/var/lib/mydir` → `var-lib-mydir`, `D:\data\x` → `D-data-x`, `/` → `root`). Both path styles are handled on every platform, so the slash-only path package is used.

Types

This section is empty.

Jump to

Keyboard shortcuts

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