fsutil

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2026 License: MIT Imports: 3 Imported by: 1 module, 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 fsutil holds file system helpers that behave the same on every platform.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Rename

func Rename(oldpath, newpath string) error

Rename renames oldpath to newpath, replacing newpath if it exists. On Windows a replace fails while another process, such as an antivirus scanner, the search indexer or another enbu, has newpath open without sharing delete access. Those failures pass on their own, so Rename retries them for a short while instead of failing the whole operation.

On Unix the rename is then made durable: the directories that hold the old and new names are synced, without which ext4, XFS and btrfs may lose the rename, and with it a new identity or checkpoint, on a power failure. The sync is best effort: the rename has happened by then, and reporting it as failed would make callers retry or roll back a change that is in place.

Types

This section is empty.

Jump to

Keyboard shortcuts

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