#41751 [Fbk->Opn]: touch() works incorrectly in Windows.

From: Date: Wed, 20 Jun 2007 21:58:56 +0000
Subject: #41751 [Fbk->Opn]: touch() works incorrectly in Windows.
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-113976@lists.php.net to get a copy of this message
ID: 41751 User updated by: aeolianmeson at blitzeclipse dot com Reported By: aeolianmeson at blitzeclipse dot com -Status: Feedback +Status: Open Bug Type: *General Issues Operating System: Windows XP SP2 PHP Version: 5.2.3 New Comment: 1182376591 1182376591 ctime doesn't appear to be afflicted. Dustin Oprea Previous Comments: ------------------------------------------------------------------------ [2007-06-20 21:53:45] sniper@php.net What does this output for you: <?php echo time(), "\n"; touch('b'); // 2nd parameter is optional.. $b = stat('b'); echo $b['ctime'], "\n"; ?> ------------------------------------------------------------------------ [2007-06-20 21:28:11] aeolianmeson at blitzeclipse dot com Description: ------------ Touch appears to always apply a timestamp that is exactly one-hour earlier then the given timestamp, in Windows. It appears to work fine in PHP 5.0.4 and 4.1.2 in Linux. Reproduce code: --------------- touch('b', 0); var_dump(stat('b')); Expected result: ---------------- array(26) { [0]=> int(2) [1]=> int(0) [2]=> int(33206) [3]=> int(1) [4]=> int(0) [5]=> int(0) [6]=> int(2) [7]=> int(0) [8]=> int(-3600) [9]=> int(-3600) [10]=> int(1182374129) [11]=> int(-1) [12]=> int(-1) ["dev"]=> int(2) ["ino"]=> int(0) ["mode"]=> int(33206) ["nlink"]=> int(1) ["uid"]=> int(0) ["gid"]=> int(0) ["rdev"]=> int(2) ["size"]=> int(0) ["atime"]=> int(0) ["mtime"]=> int(0) ["ctime"]=> int(1182374129) ["blksize"]=> int(-1) ["blocks"]=> int(-1) } Actual result: -------------- // mtime and ctime are -3600. array(26) { [0]=> int(2) [1]=> int(0) [2]=> int(33206) [3]=> int(1) [4]=> int(0) [5]=> int(0) [6]=> int(2) [7]=> int(0) [8]=> int(-3600) [9]=> int(-3600) [10]=> int(1182374129) [11]=> int(-1) [12]=> int(-1) ["dev"]=> int(2) ["ino"]=> int(0) ["mode"]=> int(33206) ["nlink"]=> int(1) ["uid"]=> int(0) ["gid"]=> int(0) ["rdev"]=> int(2) ["size"]=> int(0) ["atime"]=> int(-3600) ["mtime"]=> int(-3600) ["ctime"]=> int(1182374129) ["blksize"]=> int(-1) ["blocks"]=> int(-1) } ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=41751&edit=1

« previous php.bugs (#113976) next »