...
Package robustio
Package robustio wraps I/O functions that are prone to failure on Windows,
transparently retrying errors up to an arbitrary timeout.
Errors are classified heuristically and retries are bounded, so the functions
in this package do not completely eliminate spurious errors. However, they do
significantly reduce the rate of failure in practice.
If so, the error will likely wrap one of:
The functions in this package do not completely eliminate spurious errors,
but substantially reduce their rate of occurrence in practice.
In the call graph viewer below, each node
is a function belonging to this package
and its children are the functions it
calls—perhaps dynamically.
The root nodes are the entry points of the
package: functions that may be called from
outside the package.
There may be non-exported or anonymous
functions among them if they are called
dynamically from another package.
Click a node to visit that function's source code.
From there you can visit its callers by
clicking its declaring func
token.
Functions may be omitted if they were
determined to be unreachable in the
particular programs or tests that were
analyzed.
func IsEphemeralError(err error) bool
IsEphemeralError reports whether err is one of the errors that the functions
in this package attempt to mitigate.
Errors considered ephemeral include:
- syscall.ERROR_ACCESS_DENIED
- syscall.ERROR_FILE_NOT_FOUND
- internal/syscall/windows.ERROR_SHARING_VIOLATION
This set may be expanded in the future; programs must not rely on the
non-ephemerality of any given error.
func ReadFile(filename string) ([]byte, error)
ReadFile is like ioutil.ReadFile, but on Windows retries errors that may
occur if the file is concurrently replaced.
(See golang.org/issue/31247 and golang.org/issue/32188.)
func RemoveAll(path string) error
RemoveAll is like os.RemoveAll, but on Windows retries errors that may occur
if an executable file in the directory has recently been executed.
(See golang.org/issue/19491.)
func Rename(oldpath, newpath string) error
Rename is like os.Rename, but on Windows retries errors that may occur if the
file is concurrently read or overwritten.
(See golang.org/issue/31247 and golang.org/issue/32188.)