fileretry

package
v0.1.125 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2026 License: MIT Imports: 2 Imported by: 0 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

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