php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #565 Rewinddir not rewinding
Submitted: 1998-07-21 17:55 UTC Modified: 1998-07-21 18:39 UTC
From: leon at clearink dot com Assigned:
Status: Closed Package: Misbehaving function
PHP Version: 3.0.1 OS: Windows NT
Private report: No CVE-ID: None
 [1998-07-21 17:55 UTC] leon at clearink dot com
This bug actually has existed from RC4 through 3.0.2.  It only happens in the Windows version.  
It works fine on our Solaris box. 

This script should print a table.  The first row has all the files, the second has the file size.

<?
	print("<TABLE BORDER=\"1\">\n");

	$myDirectory = opendir(".");

	print("<TR>\n");
	print("<TH>Filename</TH>\n");

	while($entryName = readdir($myDirectory))
	{
		print("<TD>$entryName</TD>\n");
	}

	print("</TR>\n");

	rewinddir($myDirectory);

	print("<TR>\n");
	print("<TH>Size</TH>\n");

	while($entryName = readdir($myDirectory))
	{
		print("<TD>" . filesize($entryName) . "</TD>\n");
	}

	print("</TR>\n");
	
	closedir($myDirectory);

	print("</TABLE>\n");
?>

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1998-07-21 18:39 UTC] zeev
The Win32 compatability code for rewinddir() wasn't complete.
Fixed.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Apr 29 06:01:29 2024 UTC