touch()

From: Date: Wed, 24 May 2000 16:11:42 +0000
Subject: touch()
Groups: php.general 
Request: Send a blank email to php-general+get-436@lists.php.net to get a copy of this message
Trying to update the change-time of a result file to the same time as the source file using touch(). touch() seems to ignore the second argument, and always sets the change-time to the current time: <? $f1 = "$DOCUMENT_ROOT/test/file1"; $f2 = "$DOCUMENT_ROOT/test/file2"; echo "f1: ".filectime($f1)."<br>"; // prints "f1: 959183794" echo "f2: ".filectime($f2)."<br>"; // prints "f2: 959183865" echo "<p>"; touch($f2, filectime($f1)); // set ctime of f2 to ctime of f1 clearstatcache(); echo "f1: ".filectime($f1)."<br>"; // prints "f1: 959183794" echo "f2: ".filectime($f2)."<br>"; // prints "f2: 959183877" ?> Running PHP 3.0.12 on FreeBSD Any comments appreciated. Carsten H. Pedersen

« previous php.general (#436) next »