Skip to content

Commit

Permalink
Preserve file permission when copying (#2069)
Browse files Browse the repository at this point in the history
Would like to put symlink in a python module, so it will be copied
to wheel package. (I know `data` is there, but it's was not working as
I expected - #2068)

This commit will use permission from the source file
  • Loading branch information
blmarket committed May 13, 2024
1 parent fefbf52 commit dc0b104
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/module_writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1212,8 +1212,12 @@ pub fn write_python_part(
continue;
}
}
#[cfg(unix)]
let mode = absolute.metadata()?.permissions().mode();
#[cfg(not(unix))]
let mode = 0o644;
writer
.add_file(relative, &absolute)
.add_file_with_permissions(relative, &absolute, mode)
.context(format!("File to add file from {}", absolute.display()))?;
}
}
Expand Down

0 comments on commit dc0b104

Please sign in to comment.