Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Zortech C++ Language Reference - utime http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
   utime

   Usage
   #include <time.h>
   int utime(char *path, time_t times[]);

   Description
   utime changes the modified time associated with the file specified  by
   the  path  argument. The argument times contains the new  time  to  be
   applied  to the file. The times array should contain the  last  access
   time and a last modified time, respectively. Since DOS has no  concept
   of a last access time, that element is ignored. If the times  argument
   is NULL, then the current time will be used.

   Example
   #include <time.h>
   #include <stdio.h>
   main(int argc,char *argv[])
   {
        if(argc != 2)
        {
             fprintf(stderr," Usage: utime [file.name]\n");
             abort();
        }
        if(utime(argv[1],NULL) == -1)
        {
             fprintf(stderr,"Could not update file [%s]\n",argv[1]);
             abort();
        }
   }

   Return Value
   utime  returns a 0 on success and a -1 if an error occurred and  errno
   is set.


See Also: time stat fstat

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson