From: LAUN Wolfgang Date: Fri, 17 Sep 2004 14:01:11 +0000 (+0200) Subject: Re: [perl #31586] utime does not reach expectations [PATCH] X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a4142048d093908dfadd5b3e7ed8f633af464ea8;p=p5sagit%2Fp5-mst-13.2.git Re: [perl #31586] utime does not reach expectations [PATCH] Message-Id: Clarify the effect of utime when the file isn't owned by the user p4raw-id: //depot/perl@23331 --- diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod index 9d9d0a0..211bdc8 100644 --- a/pod/perlfunc.pod +++ b/pod/perlfunc.pod @@ -6400,7 +6400,8 @@ 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. For example, this code has the same effect as the -Unix touch(1) command when the files I. +Unix touch(1) command when the files I and belong to +the user running the program: #!/usr/bin/perl $atime = $mtime = time; @@ -6410,7 +6411,8 @@ 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.) +above) and will even work on other users' files where you have write +permission: utime undef, undef, @ARGV;