plan9port/src/lib9/dirwstat.c

20 lines
293 B
C
Raw Normal View History

2003-11-23 18:12:54 +00:00
#include <u.h>
#define NOPLAN9DEFINES
#include <libc.h>
#include <sys/time.h>
2003-11-24 00:43:41 +00:00
#include <utime.h>
2003-11-23 18:12:54 +00:00
int
dirwstat(char *file, Dir *dir)
{
2003-11-24 00:43:41 +00:00
struct utimbuf ub;
2003-11-23 18:12:54 +00:00
/* BUG handle more */
2003-11-25 02:36:46 +00:00
if(~dir->mtime == 0)
2003-11-23 18:12:54 +00:00
return 0;
2003-11-24 00:43:41 +00:00
ub.actime = dir->mtime;
ub.modtime = dir->mtime;
return utime(file, &ub);
2003-11-23 18:12:54 +00:00
}