Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Watcom C/C++ v10.0 : C library - <b>synopsis:</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Synopsis:
    #include <sys\utime.h>
    int utime( const char *path,
               const struct utimbuf *times );

    struct utimbuf {
        time_t   actime;    /* access time */
        time_t   modtime;   /* modification time */
    };

Description:
    The utime function records the access and modification times for the
    file identified by path.  Write access to this file must be permitted
    for the time to be recorded.

    When the times argument is NULL, the current time is recorded.
     Otherwise, the argument must point at an object whose type is  struct
    utimbuf.  The modification time is taken from the  modtime field in this
    structure.

Returns:
    The utime function returns zero when the time was successfully recorded.
     A value of -1 indicates an error occurred.

Errors:
    When an error has occurred,  errno contains a value indicating the type
    of error that has been detected.

    EACCES
        Search permission is denied for a component of path or the times
        argument is NULL and the effective user ID of the process does not
        match the owner of the file and write access is denied.

    EINVAL
        The date is before 1980 (DOS only).

    EMFILE
        There are too many open files.

    ENOENT
        The specified path does not exist or path is an empty string.


Example:
    #include <stdio.h>
    #include <sys\utime.h>

    void main( int argc, char *argv[] )
      {
        if( (utime( argv[1], NULL ) != 0) && (argc > 1) ) {
           printf( "Unable to set time for %s\n", argv[1] );
        }
      }

Classification:
    POSIX 1003.1

Systems:
    All

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