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
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: carlos at softsalsa dot com
New email:
PHP Version: OS:

 

 [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

Pull Requests

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-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 07 04:01:28 2024 UTC