Synchronet now requires the libarchive development package (e.g. libarchive-dev on Debian-based Linux distros, libarchive.org for more info) to build successfully.

Commit 29b2cb05 authored by Rob Swindell's avatar Rob Swindell 💬

CopyFile() for *nix now copies the file modification date/time too.

to mimic the behavior of the Win32 API function of the same name.
parent 8fabcdf1
Pipeline #1393 passed with stage
in 9 minutes and 15 seconds
......@@ -68,6 +68,7 @@
#include "genwrap.h" /* strupr/strlwr */
#include "dirwrap.h" /* DLLCALL */
#include "filewrap.h" /* filetime() */
#if !defined(S_ISDIR)
#define S_ISDIR(x) ((x)&S_IFDIR)
......@@ -1221,6 +1222,7 @@ BOOL CopyFile(const char* src, const char* dest, BOOL failIfExists)
return FALSE;
}
time_t ftime = filetime(fileno(in));
while(!feof(in)) {
size_t rd = fread(buf, sizeof(uint8_t), sizeof(buf), in);
if(rd < 1)
......@@ -1234,6 +1236,7 @@ BOOL CopyFile(const char* src, const char* dest, BOOL failIfExists)
fclose(in);
fclose(out);
setfdate(dest,ftime);
return success;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment