steady

package
v0.1.1096 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package steady reads and replaces files that another process may be replacing at that moment. On Windows a file being renamed over refuses to open, and one held open refuses to be renamed over, both for a moment ("Access is denied"): read as none, a file of accounts is no accounts, and the next write leaves them out. A file being renamed over is also, for a moment (two milliseconds seen), not there at all, to another process or thread: Stat and ReadThere wait that out for a file that was there. Elsewhere a rename is atomic and these are os.Stat, os.ReadFile and os.Rename.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadFile

func ReadFile(p string) ([]byte, error)

ReadFile is os.ReadFile, waiting out a file being replaced.

func ReadThere added in v0.1.945

func ReadThere(p string) ([]byte, error)

ReadThere is ReadFile of a file just found there (Stat): not there now is it being replaced, waited out.

func Rename

func Rename(oldpath, newpath string) error

Rename is os.Rename, waiting out a reader holding newpath open.

func Stat added in v0.1.945

func Stat(p string) (fs.FileInfo, error)

Stat is os.Stat of a file that was there: one being replaced is waited for, so it isn't taken for gone. A file not there costs the wait, so a caller asking again remembers it gone (filememo does).

Types

This section is empty.

Jump to

Keyboard shortcuts

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