#include "apue.h"
#include <sys/types.h>
#include <utime.h>
int main(){
struct utimbuf tbuf;
// both type of tbuf.actime and time() is time_t,
// but why can't this assignment happen?
tbuf.actime = time();
tbuf.modtime = time();
if(utime("hello.c", &tbuf) < 0)
err_sys("utime error for hello.c");
}
转载于:https://www.cnblogs.com/beanmoon/archive/2012/10/20/2732494.html