Skip to content

Commit c052cbc

Browse files
committed
debugging - try to ensure the permissions are written before returning
1 parent b50ce9d commit c052cbc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

rust/src/files.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,6 @@ pub fn unzip(
151151
create_parent_path_if_not_exists(out_path.as_path());
152152

153153
let mut outfile;
154-
// permissions must be set while creating the file in Unix-like systems, otherwise the filesystem might
155-
// report the old permissions for some milliseconds
156154
#[cfg(unix)]
157155
{
158156
use std::os::unix::fs::OpenOptionsExt;
@@ -179,6 +177,8 @@ pub fn unzip(
179177
}
180178

181179
io::copy(&mut file, &mut outfile)?;
180+
// ensure the permissions are written before returning
181+
outfile.sync_all()?;
182182
unzipped_files += 1;
183183
}
184184
}

0 commit comments

Comments
 (0)