.\" Hey Emacs! This file is -*- nroff -*- source. .\" .\" Copyright (c) 1992 Drew Eckhardt (drew@cs.colorado.edu), March 28, 1992 .\" .\" Permission is granted to make and distribute verbatim copies of this .\" manual provided the copyright notice and this permission notice are .\" preserved on all copies. .\" .\" Permission is granted to copy and distribute modified versions of this .\" manual under the conditions for verbatim copying, provided that the .\" entire resulting derived work is distributed under the terms of a .\" permission notice identical to this one .\" .\" Since the Linux kernel and libraries are constantly changing, this .\" manual page may be incorrect or out-of-date. The author(s) assume no .\" responsibility for errors or omissions, or for damages resulting from .\" the use of the information contained herein. The author(s) may not .\" have taken the same level of care in the production of this manual, .\" which is licensed free of charge, as they might when working .\" professionally. .\" .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" .\" Modified by Michael Haardt .\" Modified Sat Jul 24 13:03:05 1993 by Rik Faith .\" Modified 10 June 1995 by Andries Brouwer .\" .\" Дата последней коррекции перевода 12.12.2003 .\" Оригинальный перевод Алексея Махоткина 1999-2001 .\" .TH UTIME 2 1995-06-10 "Linux" "Руководство программиста Linux" .SH ИМЯ utime, utimes \- изменить время доступа и/или модификации inode .SH ОБЗОР .B #include .br .B #include .sp .BI "int utime(const char *" filename ", struct utimbuf *" buf ); .sp 2 .B #include .sp .BI "int utimes(char *" filename ", struct timeval *" tvp ); .SH ОПИСАНИЕ .B utime изменяет время доступа или модификации inode, указанного с помощью .IR filename , делая его равным полям .IR actime " и " modtime буфера .IR buf , соответственно. Если .I buf равен .BR NULL , то время доступа и модификации устанавливаются в текущее время. Структура .I utimbuf выглядит так: .RS .nf struct utimbuf { time_t actime; /* время доступа */ time_t modtime; /* время модификации */ }; .fi .RE В библиотеках Linux DLL 4.4.1 .B utimes является просто оберткой для .BR utime : .IR tvp [0]. tv_sec соответствует .IR actime ", а " tvp [1]. tv_sec соответствует .IR modtime . Структура .I timeval выглядит так: .RS .nf struct timeval { long tv_sec; /* секунды */ long tv_usec; /* микросекунды */ }; .fi .RE .SH "ВОЗВРАЩАЕМОЕ ЗНАЧЕНИЕ" В случае успеха возвращается ноль. При ошибке возвращается \-1, а .I errno устанавливается должным образом. .SH ОШИБКИ Могут также произойти другие ошибки. .TP 0.8i .B EACCES Не разрешена запись в файл. .TP .B ENOENT .I filename не существует. .SH "СООТВЕТСТВИЕ СТАНДАРТАМ" .BR utime : SVr4, SVID, POSIX. SVr4 документирует дополнительные коды ошибок EFAULT, EINTR, ELOOP, EMULTIHOP, ENAMETOOLONG, ENOLINK, ENOTDIR, ENOLINK, ENOTDIR, EPERM, EROFS. .br .BR utimes : BSD 4.3 .SH "СМОТРИ ТАКЖЕ" .BR stat (2) .SH ПЕРЕВОД Copyright (C) Alexey Mahotkin 1999