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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
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

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-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 23:01:27 2024 UTC