fsutil

package
v2.3.0-rc.0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2026 License: Apache-2.0 Imports: 5 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsNFS

func IsNFS(path string) (bool, error)

IsNFS checks if the path is on NFS. If the path does not exist yet, it will walk up parent directories until one exists, or it hits '/' or '.'. Any other stat errors will cause IsNFS to fail.

func WindowsSubsystemPath added in v2.2.0

func WindowsSubsystemPath(_ context.Context, _ string) (string, error)

WindowsSubsystemPath is the non-Windows stub for the Windows-only implementation in fsutil_windows.go.

func WindowsSubsystemPathForLinux added in v2.2.0

func WindowsSubsystemPathForLinux(_ context.Context, _, _ string) (string, error)

WindowsSubsystemPathForLinux is the non-Windows stub for the Windows-only implementation in fsutil_windows.go.

func WindowsSubsystemPathWithCygpath added in v2.2.0

func WindowsSubsystemPathWithCygpath(_ context.Context, _, _ string) (string, error)

WindowsSubsystemPathWithCygpath is the non-Windows stub for the Windows-only implementation in fsutil_windows.go.

func WriteFileAtomic added in v2.3.0

func WriteFileAtomic(path string, data []byte) error

WriteFileAtomic writes data to a temp file in path's directory and renames it onto path, so a reader sees the old file or the whole new one, never a partial write; the rename is atomic on Unix only. os.CreateTemp requests 0600, so the result is 0600 masked by the umask (0600 under a typical umask).

Types

This section is empty.

Jump to

Keyboard shortcuts

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