From:             soapergem at gmail dot com
Operating system: Windows XP
PHP version:      5.2.9
PHP Bug Type:     Filesystem function related
Bug description:  touch() does not modify accessed time in Windows

Description:
------------
The touch() command does not actually modify the accessed time of a file
on a Windows platform. After calling touch() on a file with an access time
specified, the access time is set to the current time.

Reproduce code:
---------------
<?php

$file = 'C:\\test.txt';
$mtime = filemtime($file);
$atime = fileatime($file);

$newtime = mktime(0, 0, 0, 1, 1, 2009);
$result1 = touch($file, $mtime, $newtime);
$result2 = ( $atime != fileatime($file) );

var_dump($result1);
var_dump($result2);

?>

Expected result:
----------------
On the first run, we should expect the file C:\test.txt to have an access
time of January 1st, 2009, and this expected PHP output:

bool(true)
bool(true)


Actual result:
--------------
Instead, the file C:\test.txt will have an access time of whenever the
script ran, and this is the PHP output we get:

bool(true)
bool(false)


-- 
Edit bug report at http://bugs.php.net/?id=48454&edit=1
-- 
Try a CVS snapshot (PHP 5.2):        
http://bugs.php.net/fix.php?id=48454&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):        
http://bugs.php.net/fix.php?id=48454&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):        
http://bugs.php.net/fix.php?id=48454&r=trysnapshot60
Fixed in CVS:                        
http://bugs.php.net/fix.php?id=48454&r=fixedcvs
Fixed in CVS and need be documented: 
http://bugs.php.net/fix.php?id=48454&r=needdocs
Fixed in release:                    
http://bugs.php.net/fix.php?id=48454&r=alreadyfixed
Need backtrace:                      
http://bugs.php.net/fix.php?id=48454&r=needtrace
Need Reproduce Script:               
http://bugs.php.net/fix.php?id=48454&r=needscript
Try newer version:                   
http://bugs.php.net/fix.php?id=48454&r=oldversion
Not developer issue:                 
http://bugs.php.net/fix.php?id=48454&r=support
Expected behavior:                   
http://bugs.php.net/fix.php?id=48454&r=notwrong
Not enough info:                     
http://bugs.php.net/fix.php?id=48454&r=notenoughinfo
Submitted twice:                     
http://bugs.php.net/fix.php?id=48454&r=submittedtwice
register_globals:                    
http://bugs.php.net/fix.php?id=48454&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=48454&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=48454&r=dst
IIS Stability:                       
http://bugs.php.net/fix.php?id=48454&r=isapi
Install GNU Sed:                     
http://bugs.php.net/fix.php?id=48454&r=gnused
Floating point limitations:          
http://bugs.php.net/fix.php?id=48454&r=float
No Zend Extensions:                  
http://bugs.php.net/fix.php?id=48454&r=nozend
MySQL Configuration Error:           
http://bugs.php.net/fix.php?id=48454&r=mysqlcfg

Reply via email to