utime.h File Reference

Typedef time_t

typedef __time_t time_t

_TIME_T_DECLARED

utime ( const char *, const struct utimbuf * )

IMPORT_C intutime(const char *,
const struct utimbuf *
)

This interface is obsoleted by utimes.

The utime function sets the access and modification times of the named file from the actime and modtime fields of the struct utimbuf pointed at by filetimes.

If the times are specified (the timep argument is non- NULL) the caller must be the owner of the file or be the super-user.

If the times are not specified (the timep argument is NULL) the caller must be the owner of the file, have permission to write the file, or be the super-user.

Examples:
/* Detailed description:  Sample usage of utime system call
  Preconditions:  Example.txt file should exist in the working directory
 */
#include <stdio.h>
#include <utime.h>
int main()
{
  struct utimbuf Time ;
  if(utime("Example.txt" , &Time;) < 0 ) 
  {
     printf("Utime call failed") ;
     return -1 ;
  }
  printf("Utime call succeded") ;
  return 0 ;
}
Output
Utime call succeded

Limitations:

KErrNotReady of Symbian error code is mapped to ENOENT, which typically means drive not found or filesystem not mounted on the drive.

See also: stat() utimes()

Return Value
errno is set appropriately.
Capability
Deferred