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++ 3.0r4 - <b>utime</b> 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. If the times argument is NULL, then the
   current time will be used.

Example 

   #include <stdio.h>
   #include <stdlib.h>
   #include <time.h>

   int 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 EXIT_SUCCESS;
   }

Return Value

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


See Also

   time, stat, fstat




See Also: time stat fstat

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