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 1ab9ba58 authored by rswindell's avatar rswindell

Created setfdate() function (wrapper for utime).

parent dd694b4f
......@@ -338,7 +338,7 @@ void rewinddir(DIR* dir)
/****************************************************************************/
/* Returns the time/date of the file in 'filename' in time_t (unix) format */
/****************************************************************************/
time_t DLLCALL fdate(const char *filename)
time_t DLLCALL fdate(const char* filename)
{
struct stat st;
......@@ -351,6 +351,21 @@ time_t DLLCALL fdate(const char *filename)
return(st.st_mtime);
}
/****************************************************************************/
/* Change the access and modification times for specified filename */
/****************************************************************************/
int DLLCALL setfdate(const char* filename, time_t t)
{
struct utimbuf ut;
memset(&ut,0,sizeof(ut));
ut.actime=t;
ut.modtime=t;
return(utime(filename,&ut));
}
/****************************************************************************/
/* Returns the length of the file in 'filename' */
/****************************************************************************/
......
......@@ -207,6 +207,7 @@ DLLEXPORT BOOL DLLCALL fexist(const char *filespec);
DLLEXPORT BOOL DLLCALL fexistcase(char *filespec); /* fixes upr/lwr case fname */
DLLEXPORT long DLLCALL flength(const char *filename);
DLLEXPORT time_t DLLCALL fdate(const char *filename);
DLLEXPORT int DLLCALL setfdate(const char* filename, time_t t);
DLLEXPORT BOOL DLLCALL isdir(const char *filename);
DLLEXPORT char* DLLCALL getfname(const char* path);
DLLEXPORT int DLLCALL getfattr(const char* filename);
......
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