Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]

#include <utime.h>
Link against: libc.lib

utime(const char *,const struct utimbuf *)

Interface status: externallyDefinedApi

IMPORT_C int utime(const char *, const struct utimbuf *);

Description

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
 */
# 39 "d:/EPOC/release/9.4/common/generic/openenv/core/include/utime.dosc" 2
# 40 "d:/EPOC/release/9.4/common/generic/openenv/core/include/utime.dosc" 2
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 2 , which typically means drive not found or filesystem not mounted on the drive.

Parameters

const char *

const struct utimbufutimbuf *

Return value

int

errno is set appropriately.

See also: