Documentation
¶
Overview ¶
Package fsutil provides filesystem utilities that abstract over OS-specific behaviour differences, particularly Windows mandatory file locking.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RobustRename ¶
RobustRename calls os.Rename with retry on transient Windows file-locking errors (ERROR_ACCESS_DENIED, ERROR_SHARING_VIOLATION). On POSIX systems rename never fails from transient locks, so retries add zero overhead in the success path and fail immediately on the first error.
The retry budget is ~155 ms (5 attempts: 5, 10, 20, 40, 80 ms). This gives external processes (Windows Defender, Search Indexer) time to release handles opened for scanning after a file write/close.
Callers MUST fsync and close the source file before calling RobustRename.
Types ¶
This section is empty.