os/ossrv/genericopenlibs/openenvcore/include/utime.dosc
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
sl@0
     1
/** @file  ../include/utime.h
sl@0
     2
@internalComponent
sl@0
     3
*/
sl@0
     4
sl@0
     5
/** @struct utimbuf
sl@0
     6
sl@0
     7
The utimbuf structure is used with the utime function to specify new access and modification times for a file. It contains the following members:
sl@0
     8
sl@0
     9
@publishedAll
sl@0
    10
@externallyDefinedApi
sl@0
    11
*/
sl@0
    12
sl@0
    13
/** @var utimbuf::actime
sl@0
    14
Access time 
sl@0
    15
*/
sl@0
    16
sl@0
    17
/** @var utimbuf::modtime
sl@0
    18
Modification time 
sl@0
    19
*/
sl@0
    20
sl@0
    21
/** @fn  utime(const char *name, const struct utimbuf *filetimes)
sl@0
    22
@param name
sl@0
    23
@param filetimes
sl@0
    24
@return   errno is set appropriately.
sl@0
    25
sl@0
    26
  This interface is obsoleted by utimes.
sl@0
    27
sl@0
    28
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.
sl@0
    29
sl@0
    30
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.
sl@0
    31
sl@0
    32
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.
sl@0
    33
sl@0
    34
Examples:
sl@0
    35
@code
sl@0
    36
/* Detailed description:  Sample usage of utime system call
sl@0
    37
 *  Preconditions:  Example.txt file should exist in the working directory
sl@0
    38
 */
sl@0
    39
#include <stdio.h>
sl@0
    40
#include <utime.h>
sl@0
    41
int main()
sl@0
    42
{
sl@0
    43
  struct utimbuf Time ;
sl@0
    44
  if(utime("Example.txt" , &Time;) < 0 ) 
sl@0
    45
  {
sl@0
    46
     printf("Utime call failed") ;
sl@0
    47
     return -1 ;
sl@0
    48
  }
sl@0
    49
  printf("Utime call succeded") ;
sl@0
    50
  return 0 ;
sl@0
    51
}
sl@0
    52
sl@0
    53
@endcode
sl@0
    54
 Output
sl@0
    55
@code
sl@0
    56
Utime call succeded
sl@0
    57
sl@0
    58
@endcode
sl@0
    59
sl@0
    60
Limitations:
sl@0
    61
sl@0
    62
KErrNotReady of Symbian error code is mapped to ENOENT, which typically means drive
sl@0
    63
not found or filesystem not mounted on the drive.
sl@0
    64
sl@0
    65
@see stat()
sl@0
    66
@see utimes()
sl@0
    67
sl@0
    68
sl@0
    69
sl@0
    70
@capability Deferred @ref RFs::SetModified(const TDesC16&, const TTime&)
sl@0
    71
sl@0
    72
@publishedAll
sl@0
    73
@externallyDefinedApi
sl@0
    74
*/