Documentation
¶
Overview ¶
Package filesystem provides utility functions for file system operations.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CopyDir ¶
CopyDir recursively copies a directory tree, attempting to preserve permissions. Source directory must exist, destination directory must *not* exist. Uses Lstat on the source root to reject symlinks and prevent following links to attacker-controlled locations.
func CopyFile ¶
CopyFile copies a single file from src to dst. Rejects symlinks as source to prevent symlink-based attacks. Uses Lstat pre-check for symlinks, then open-then-fstat for size validation.
func CreateSymlinkOrCopy ¶
CreateSymlinkOrCopy creates a symlink from target to source, or falls back to copy on failure. Uses relative paths for portability. Works on Linux, macOS, and Windows (with fallback).
Types ¶
This section is empty.