Go to the first, previous, next, last section, table of contents.


utime

Syntax

#include <utime.h>

int utime(const char *file, const struct utimbuf *time);

Description

This function sets the modification timestamp on the file. The new time is stored in this structure:

struct utimbuf
{
    time_t  actime;  /* access time (unused on FAT filesystems) */
    time_t  modtime; /* modification time */
};

Note that, as under DOS a file only has a single timestamp, the actime field of struct utimbuf is ignored by this function, and only modtime field is used. On filesystems which support long filenames, both fields are used and both access and modification times are set.

Return Value

Zero for success, nonzero for failure.

Portability

not ANSI, POSIX

Example

struct utimbuf t;
t.modtime = time(0);
utime("data.txt", &t);


Go to the first, previous, next, last section, table of contents.