pub fn write_bytes(path: &Path, data: &[u8]) -> Result<()>
Write binary data to a file atomically with file locking