change the atomic write functions to work with readers

This commit is contained in:
Kovid Goyal
2024-07-22 15:01:19 +05:30
parent d31c48092a
commit c906314974
7 changed files with 15 additions and 11 deletions

View File

@@ -50,7 +50,7 @@ func extract_files(match, dest_dir string) (err error) {
if existing, rerr := os.ReadFile(dest); rerr == nil && bytes.Equal(existing, entry.Data) {
continue
}
if err = utils.AtomicWriteFile(dest, entry.Data, 0o644); err != nil {
if err = utils.AtomicWriteFile(dest, bytes.NewReader(entry.Data), 0o644); err != nil {
return
}
}