Skip to content

Commit

Permalink
set mode on open
Browse files Browse the repository at this point in the history
  • Loading branch information
dsherret committed Dec 27, 2024
1 parent 3c2ecef commit e2e722a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,9 @@ pub fn atomic_write_file<
data: &[u8],
mode: u32,
) -> std::io::Result<()> {
let mut file = sys.fs_open(temp_file_path, &OpenOptions::write())?;
file.fs_file_set_permissions(mode)?;
let mut options = OpenOptions::write();
options.mode = Some(mode);
let mut file = sys.fs_open(temp_file_path, &options)?;
file.write_all(data)?;
sys
.fs_rename(temp_file_path, file_path)
Expand Down

0 comments on commit e2e722a

Please sign in to comment.