fsutil

package
v0.0.0-...-63ae334 Latest Latest
Warning

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

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

Documentation

Overview

Package fsutil holds small filesystem helpers shared across koder.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanAbs

func CleanAbs(path string) string

CleanAbs returns path as a cleaned absolute path, or "" for a blank path. If the working directory cannot be determined, it returns path cleaned.

func Within

func Within(root, path string) bool

Within reports whether path is root or lies inside it. The comparison is lexical: both paths are cleaned, but symlinks are not resolved.

func WriteFileAtomic

func WriteFileAtomic(path string, data []byte, mode fs.FileMode) (err error)

WriteFileAtomic replaces path with data. It writes and syncs a temporary file in the same directory, then renames it over path, so readers see either the old or the new content, never a partial write.

Types

This section is empty.

Jump to

Keyboard shortcuts

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