mirror of
https://github.com/diegocr/libnix.git
synced 2025-12-08 14:58:32 +00:00
17 lines
314 B
C
17 lines
314 B
C
#include <sys/time.h>
|
|
#include <utime.h>
|
|
|
|
int utime(const char *file, const struct utimbuf *timep)
|
|
{ struct timeval times[2],*t=NULL;
|
|
|
|
if (timep) {
|
|
t = ×[0];
|
|
t[0].tv_sec = timep->actime;
|
|
t[0].tv_usec = 0;
|
|
t[1].tv_sec = timep->modtime;
|
|
t[1].tv_usec = 0;
|
|
}
|
|
|
|
return utimes(file,t);
|
|
}
|