Skip to content

Commit

Permalink
Merge pull request #26 from Firaenix/main
Browse files Browse the repository at this point in the history
Truncate file when opening service manifest for writing
  • Loading branch information
jacderida authored Jul 13, 2024
2 parents 2a76017 + e961a34 commit a749402
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use std::{
/// Writes/overwrites a file, assigning the permissions of `mode` if on a unix system
pub fn write_file(path: &Path, data: &[u8], _mode: u32) -> io::Result<()> {
let mut opts = OpenOptions::new();
opts.create(true).write(true);
opts.create(true).write(true).truncate(true);

#[cfg(unix)]
{
Expand Down

0 comments on commit a749402

Please sign in to comment.