refactor: merge File/FileReceive, add optional metadata transfer with -M flag
- Remove FileReceive struct; use File everywhere with nullable FileMetadata* - Remove struct stat from File; file size lives in Data->size (data_create_reserve) - Add FileMetadata struct (mode, uid, gid, mtime) sent conditionally over wire - Add -M / --preserve flag to client - Restore permissions, ownership, timestamps on disk write - Wire format uses per-file present flag for metadata (zero overhead when off)
This commit is contained in:
@@ -1,9 +1,12 @@
|
||||
#ifndef UTILS_H
|
||||
#define UTILS_H
|
||||
|
||||
#include "file.h"
|
||||
|
||||
void mkdir_r(char *path);
|
||||
char *str_dup(char *string);
|
||||
void to_disk(char *path, void *data, unsigned long long data_size);
|
||||
void file_restore_metadata(const char *path, FileMetadata *metadata);
|
||||
char *path_cat(char *path1, char *path2);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user