From: Casey West Date: Fri, 25 Apr 2003 08:00:54 +0000 (-0400) Subject: utime() doc clarifications X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=4bc2a53d56342b38b43b34f3eb45a2da19b2984f;p=p5sagit%2Fp5-mst-13.2.git utime() doc clarifications based on : Subject: Re: [PATCH] [perl #18589] Add NFS warning, clarify touch example Message-ID: <20030425120054.GQ34510@geeknest.com> p4raw-id: //depot/perl@19353 --- diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod index 70e604b..192658f 100644 --- a/pod/perlfunc.pod +++ b/pod/perlfunc.pod @@ -6148,17 +6148,22 @@ Changes the access and modification times on each file of a list of files. The first two elements of the list must be the NUMERICAL access and modification times, in that order. Returns the number of files successfully changed. The inode change time of each file is set -to the current time. This code has the same effect as the C -command if the files already exist: +to the current time. For example, this code has the same effect as the +Unix touch(1) command when the files I. #!/usr/bin/perl $now = time; utime $now, $now, @ARGV; -If the first two elements of the list are C, then the utime(2) -function in the C library will be called with a null second argument. -On most systems, this will set the file's access and modification -times to the current time. (i.e. equivalent to the example above.) +B Under NFS, touch(1) uses the time of the NFS server, not +the time of the local machine. If there is a time synchronization +problem, the NFS server and local machine will have different times. + +Since perl 5.7.2, if the first two elements of the list are C, then +the utime(2) function in the C library will be called with a null second +argument. On most systems, this will set the file's access and +modification times to the current time (i.e. equivalent to the example +above.) utime undef, undef, @ARGV;