1 .\" Hey Emacs! This file is -*- nroff -*- source.
3 .\" Copyright (c) 1992 Drew Eckhardt (drew@cs.colorado.edu), March 28, 1992
5 .\" Permission is granted to make and distribute verbatim copies of this
6 .\" manual provided the copyright notice and this permission notice are
7 .\" preserved on all copies.
9 .\" Permission is granted to copy and distribute modified versions of this
10 .\" manual under the conditions for verbatim copying, provided that the
11 .\" entire resulting derived work is distributed under the terms of a
12 .\" permission notice identical to this one.
14 .\" Since the Linux kernel and libraries are constantly changing, this
15 .\" manual page may be incorrect or out-of-date. The author(s) assume no
16 .\" responsibility for errors or omissions, or for damages resulting from
17 .\" the use of the information contained herein. The author(s) may not
18 .\" have taken the same level of care in the production of this manual,
19 .\" which is licensed free of charge, as they might when working
22 .\" Formatted or processed versions of this manual, if unaccompanied by
23 .\" the source, must acknowledge the copyright and authors of this work.
25 .\" Modified by Michael Haardt <michael@moria.de>
26 .\" Modified 1993-07-24 by Rik Faith <faith@cs.unc.edu>
27 .\" Modified 1995-06-10 by Andries Brouwer <aeb@cwi.nl>
28 .\" Modified 2004-06-23 by Michael Kerrisk <mtk.manpages@gmail.com>
29 .\" Modified 2004-10-10 by Andries Brouwer <aeb@cwi.nl>
31 .\" Japanese Version Copyright (c) 1997 SUTO, Mitsuaki
32 .\" all rights reserved.
33 .\" Translated Thu Jun 26 21:28:00 JST 1997
34 .\" by SUTO, Mitsuaki <suto@av.crl.sony.co.jp>
35 .\" Updated & Modified Tue Feb 15 03:21:17 JST 2005
36 .\" by Yuichi SATO <ysato444@yahoo.co.jp>
37 .\" Updated 2006-07-21, Akihiro MOTOKI, LDP v2.36
38 .\" Updated 2007-10-13, Akihiro MOTOKI, LDP v2.65
39 .\" Updated 2008-08-08, Akihiro MOTOKI, LDP v3.05
41 .TH UTIME 2 2008-08-06 "Linux" "Linux Programmer's Manual"
43 utime, utimes \- ファイルの最終アクセス時刻と修正時刻を変更する
46 .B #include <sys/types.h>
50 .BI "int utime(const char *" filename ", const struct utimbuf *" times );
52 .B #include <sys/time.h>
54 .BI "int utimes(const char *" filename ", const struct timeval " times [2]);
60 で示される inode のアクセス時刻と修正時刻を
63 .IR actime " と " modtime
69 の場合、ファイルのアクセス時刻と修正時刻は現在の時刻に設定される。
71 タイムスタンプの変更は以下のいずれかの場合に許可される。
73 実効 (effective) ユーザ ID がファイルのユーザ ID と等しい場合、
75 が NULL かつ、プロセスがファイルへの書き込み許可を持っている場合。
84 time_t actime; /* アクセス時刻 */
85 time_t modtime; /* 修正時刻 */
91 システムコールは 1 秒の分解能でタイムスタンプを指定することができる。
101 構造体で、タイムスタンプの指定を 1 マイクロ秒の分解能で行うことができる。
110 long tv_usec; /* マイクロ秒 */
122 同様、ファイルのアクセス時刻と修正時刻は現在の時刻に設定される。
124 成功した場合 0 が返る。失敗した場合 \-1 が返り、
131 を構成する何れかのディレクトリに検索許可がない
132 .RB ( path_resolution (7)
138 または、呼び出し元の実効ユーザ ID がファイルの所有者と一致しない。
139 または、呼び出し元がそのファイルへの書き込み許可を持たず、
140 特権も持っていない (Linux の場合、ケーパビリティ
152 が NULL でなく、かつ呼び出し元の実効 UID がファイルの所有者と一致せず、
160 が読み込み専用のファイルシステム上にある。
169 4.3BSD, POSIX.1-2001.
171 Linux では、不変 (immutable) ファイルのタイムスタンプを変更したり、
172 追加専用 (append-only) のファイルに現在時刻以外のタイムスタンプを