utime
       #include < sys/types.h >
       #include < utime.h >

       int utime(const char *filename, const struct utimbuf *times);

예제 참고
http://www.joinc.co.kr/modules/moniwiki/wiki.php/man/2/utime

#include < sys/types.h >
#include < utime.h >
#include < sys/time.h >
#include < stdio.h >
#include < string.h >

int main()
{
    struct utimbuf ubuf;
    ubuf.actime = time((time_t *)0);
    ubuf.modtime = time((time_t *)0);

    // 접근,수정 시간을 현재 시간으로 변경한다.
    utime("sizeof.c", NULL);

    // NULL 대신 actime,modtime 을 세팅해서 
    // 직접 값을 지정해줄수도 있다. 
    utime("sizeof.c", &ubuf);
    return 0;
}

+ Recent posts