Help us shape the future of Go! Take the 2026 Go Developer Survey

fileretry

package
v0.1.49 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package fileretry retries a file operation that Windows refuses while another process holds the file for a moment, such as a game reading its configuration, a scanner opening a file just written, or a reader that did not share deletion. Other systems never refuse those operations, so the operation runs once there.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Do

func Do(op func() error) error

Do runs op, and runs it again while it fails because another process holds the file, for up to five seconds. It returns op's last error. op must leave the file as it found it when it fails, as a whole read, write or rename does.

func Rename

func Rename(oldpath, newpath string) error

Rename renames oldpath to newpath as os.Rename does, retrying while another process holds either one, as Do does.

Types

This section is empty.

Jump to

Keyboard shortcuts

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