Record the modification time for a file
#include <utime.h> int futime( int fildes, const struct utimbuf *times ); struct utimbuf { time_t actime; /* access time */ time_t modtime; /* modification time */ };
libc
Use the -l c option to qcc to link against this library. This library is usually included automatically.
The futime() function records the modification time for the file or directory with the descriptor, fildes.
If the times argument is NULL, the access and modification times of the file or directory are set to the current time. The effective user ID of the process must match the owner of the file or directory, or the process must have write permission to the file or directory, or appropriate privileges in order to use the futime() function in this way.
If the times argument isn't NULL, it's interpreted as a pointer to a utimbuf structure, and the access and modification times of the file or directory are set to the values contained in the actime and modtime fields in this structure. Only the owner of the file or directory, and processes with appropriate privileges are permitted to use the futime() function in this way.
Safety: | |
---|---|
Cancellation point | No |
Interrupt handler | No |
Signal handler | Yes |
Thread | Yes |