File stats are now correctly copied over to archive

main
Jef Roosens 2022-01-20 17:45:04 +01:00
parent b6e9fa5b02
commit 01d961f68e
Signed by untrusted user: Jef Roosens
GPG Key ID: B580B976584B5F30
2 changed files with 5 additions and 5 deletions

View File

@ -92,7 +92,7 @@ fn C.archive_entry_set_perm(&C.archive_entry, int)
fn C.archive_entry_clear(&C.archive_entry)
// Copy over a stat struct to the archive entry
fn C.archive_entry_copy_stat(&C.archive_entry, &C.stat)
fn C.archive_entry_copy_stat(entry &C.archive_entry, const_stat &C.stat)
#include <string.h>

View File

@ -119,10 +119,10 @@ fn (r &Repo) sync() ? {
}
C.archive_entry_set_pathname(entry, &char(inner_path.str))
// C.archive_entry_copy_stat(entry, &st)
C.archive_entry_set_size(entry, st.st_size)
C.archive_entry_set_filetype(entry, C.AE_IFREG)
C.archive_entry_set_perm(entry, 0o644)
C.archive_entry_copy_stat(entry, &st)
// C.archive_entry_set_size(entry, st.st_size)
// C.archive_entry_set_filetype(entry, C.AE_IFREG)
// C.archive_entry_set_perm(entry, 0o644)
C.archive_write_header(a, entry)
fd := C.open(&char(actual_path.str), C.O_RDONLY)