fsutil

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package fsutil provides durable filesystem helpers shared by the agent library and the agent commands.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InstallFile

func InstallFile(source, target string, mode os.FileMode) (err error)

InstallFile streams source onto target atomically. Large executables are copied rather than buffered in memory.

func SyncDir

func SyncDir(path string) error

SyncDir persists a directory entry so newly written names survive a crash.

func SyncFilesystems

func SyncFilesystems(paths ...string) error

SyncFilesystems persists every filesystem backing the given paths.

func SyncOpenFilesystems

func SyncOpenFilesystems(files []*os.File, syncfs func(int) error) error

SyncOpenFilesystems synchronizes each distinct filesystem once, using open handles that stay valid after teardown removes their paths.

func WriteFileDurable

func WriteFileDurable(path string, data []byte, mode os.FileMode) error

WriteFileDurable also persists newly created parent directories, so the written file cannot outlive the directory entries needed to reach it.

Types

This section is empty.

Jump to

Keyboard shortcuts

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