From e2a71b0366aa80a7cf131fdbde6012671493d364 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yaroslav=20de=20la=20Pe=C3=B1a=20Smirnov?= Date: Tue, 9 Nov 2021 20:47:16 +0300 Subject: Copy/sync static files --- include/fs.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/fs.h b/include/fs.h index 015214a..973d585 100644 --- a/include/fs.h +++ b/include/fs.h @@ -37,7 +37,18 @@ const char *delext(const char *restrict basename, char *restrict dest, size_t n) */ int file_is_uptodate(const char *path, const struct timespec *srcmtim); -/* Sets access and modification times to the time passed */ +/* + * Sets access and modification times to the time passed. + */ void setdatetime(const char *path, const struct timespec *mtim); +/* + * Copies file(s) truncating and overwritting the file(s) in the destination + * path if they exist and are not a directory, or creating them if they don't + * exist. If srcpath is a directory, copies all files within that directory + * recursively. Only copies the regular files that already exist if their + * timestamps do not match. + */ +bool filesync(const char *restrict srcpath, const char *restrict dstpath); + #endif -- cgit v1.2.3