php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #6767 filemtime not working
Submitted: 2000-09-15 01:00 UTC Modified: 2001-01-08 15:48 UTC
From: carlos at softsalsa dot com Assigned:
Status: Closed Package: Filesystem function related
PHP Version: 4.0.2 OS: W98
Private report: No CVE-ID: None
 [2000-09-15 01:00 UTC] carlos at softsalsa dot com
<?
$handle=opendir('.');
while (($file = readdir($handle))!==false) {
	$filedate = date("d-m-Y H:i:s",filemtime($file));
	echo $filedate."<br>";
}
closedir($handle); 
?>

filemtime returns 0 for all files on a directory except for . and ..



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-01-08 15:48 UTC] cynic@php.net
can you check whether this still errs with 4.0.4 or latest CVS? if so, reopen this bug report.
it works for me(TM) with today's CVS mod_php4 on NT5.
 [2002-01-12 23:16 UTC] ken dot gregg at rwre dot com
OS FreeBSD 4.0 php 4.06

This code works fine if you use '.' for the dir. But if you
use './somesubdir' filemtime always returns false. Could it be looking for the filename string in the current dir regarless of the filename passed?
 
PHP Copyright © 2001-2017 The PHP Group
All rights reserved.
Last updated: Sun Nov 19 01:31:42 2017 UTC