iocopy

package
v0.32.1 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package iocopy provides byte-for-byte filesystem copy primitives shared by the eval promote pipeline and the online sampler plugin.

Both callers need the same guarantees: a journal directory copied recursively, regular files preserved bit-for-bit, symlinks not followed, and special files (sockets, devices) skipped. Centralizing the helper here keeps the two callers from drifting and makes the contract auditable in one place.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyDir

func CopyDir(src, dst string) error

CopyDir recursively copies src into dst (which is created as needed). Behavior contract:

  • Regular files are copied byte-for-byte; mode bits are preserved.
  • Directories are created with mode 0o755.
  • Symlinks are not followed and not recreated; they are surfaced as an error so callers explicitly decide whether to allow them. Journal directories never contain symlinks, so this is the safe default.
  • Special files (sockets, devices, named pipes) are skipped silently.
  • dst may exist already; existing files at the same relative path are overwritten. Pre-existing extra files at dst are left untouched — callers wanting a clean target should remove dst first.

On error, CopyDir returns immediately with a wrapped error; partial state at dst is the caller's responsibility to clean up.

func CopyFile

func CopyFile(src, dst string) error

CopyFile copies the contents of src to dst, preserving file mode. Parent directories are created if missing. Existing files at dst are overwritten in-place.

Types

This section is empty.

Jump to

Keyboard shortcuts

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