home *** CD-ROM | disk | FTP | other *** search
/ PC Extra Super CD 1998 January / PCPLUS131.iso / DJGPP / V2 / DJLSR201.ZIP / src / libc / posix / utime / utime.txh < prev   
Encoding:
Text File  |  1996-09-26  |  941 b   |  41 lines

  1. @node utime, file system
  2. @subheading Syntax
  3.  
  4. @example
  5. #include <utime.h>
  6.  
  7. int utime(const char *file, const struct utimbuf *time);
  8. @end example
  9.  
  10. @subheading Description
  11.  
  12. This function sets the modification timestamp on the @var{file}.  The
  13. new time is stored in this structure:
  14.  
  15. @example
  16. struct utimbuf
  17. @{
  18.     time_t  actime;  /* access time (unused on FAT filesystems) */
  19.     time_t  modtime; /* modification time */
  20. @};
  21. @end example
  22.  
  23. Note that, as under DOS a file only has a single timestamp, the
  24. @code{actime} field of @code{struct utimbuf} is ignored by this
  25. function, and only @code{modtime} field is used.  On filesystems which
  26. support long filenames, both fields are used and both access and
  27. modification times are set.
  28.  
  29. @subheading Return Value
  30.  
  31. Zero for success, nonzero for failure.
  32.  
  33. @subheading Example
  34.  
  35. @example
  36. struct utimbuf t;
  37. t.modtime = time(0);
  38. utime("data.txt", &t);
  39. @end example
  40.  
  41.