MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / is_transient_windows_file_lock

Function is_transient_windows_file_lock

src/sync.rs:78–85  ·  view source on GitHub ↗

True for Windows errors that indicate another process is briefly holding the file: `ERROR_SHARING_VIOLATION` (32) and `ERROR_LOCK_VIOLATION` (33) map through as raw OS errors, while Defender-style scans surface as plain `PermissionDenied` (`ERROR_ACCESS_DENIED`, os error 5).

(err: &std::io::Error)

Source from the content-addressed store, hash-verified

76/// map through as raw OS errors, while Defender-style scans surface as plain
77/// `PermissionDenied` (`ERROR_ACCESS_DENIED`, os error 5).
78fn is_transient_windows_file_lock(err: &std::io::Error) -> bool {
79 const ERROR_SHARING_VIOLATION: i32 = 32;
80 const ERROR_LOCK_VIOLATION: i32 = 33;
81 matches!(
82 err.raw_os_error(),
83 Some(ERROR_SHARING_VIOLATION | ERROR_LOCK_VIOLATION)
84 ) || err.kind() == std::io::ErrorKind::PermissionDenied
85}
86
87/// Get filesystem mtime (seconds since epoch) and size for pre-filter.
88pub fn file_stat(path: &Path) -> Option<(i64, u64)> {

Callers 1

read_file_bytesFunction · 0.85

Calls 1

kindMethod · 0.80

Tested by

no test coverage detected