Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CopyFileAtomic ¶
CopyFileAtomic performs an atomic streaming copy from src to dst. It writes to a temporary file first, then renames it to the destination. This ensures the destination file is never in a partially written state.
Features:
- Streaming copy (memory-safe for large files)
- Atomic rename (most filesystems)
- Automatic cleanup of temp files on error
- Preserves source file permissions
- Unique temp filenames (safe for concurrent writes to same destination)
Returns an error if any operation fails (open, copy, close, rename).
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.