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 ¶
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.