Scroll to navigation

UTIME(2) Manual do Programador Linux UTIME(2)

NOME

utime, utimes - altera a data de acesso ou modificação de um inode

SINOPSE

#include <sys/types.h>
 
#include <utime.h>
int utime(const char *filename, struct utimbuf *buf);
#include <sys/time.h>
int utimes(char *filename, struct timeval *tvp);

DESCRIÇÃO

utime altera a data de acessou modificação de um inode especificado por filename para os respectivos campos actime e modtime do buf buf é NULL, então a data de acesso e modificação dos arquivos são modificadas para a data atual. A estrutura utimbuf é:
struct utimbuf {
        time_t actime;  /* access time */
        time_t modtime; /* modification time */
};
Nas bibliotecas DLL 4.4.1 do Linux, utimes é justamente uma capa para utime: tvp[0].tv_sec é actime, e tvp[1].tv_sec é modtime. A estrutura timeval é:
struct timeval {
        long    tv_sec;         /* seconds */
        long    tv_usec;        /* microseconds */
};

VALORES RETORNADOS

Em caso de sucesso, zero é retornado. Caso contrário, -1 é retornado, e errno é selecionado adequadamente.

ERRORS

Outros erros podem ocorrer.
EACCES
A permissão para escrever no arquivo é negada.
ENOENT
filename não existe.

DE ACORDO COM

utime: SVr4, SVID, POSIX. Na documentação SVr4 condições de erros adicionais EFAULT, EINTR, ELOOP, EMULTIHOP, ENAMETOOLONG, ENOLINK, ENOTDIR, ENOLINK, ENOTDIR, EPERM, EROFS.
 
utimes: BSD 4.3

VEJA TAMBÉM

stat(2)

TRADUZIDO POR LDP-BR em 21/08/2000.

André L. Fassone Canova <lonelywolf@blv.com.br> (tradução) xxxxxxxxxxxxxxxxxxxxxxxxx <xxx@xxxxxx.xxx.xx> (revisão)
10/06/1995 Linux