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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: leon at clearink dot com
New email:
PHP Version: OS:

 

 [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

Pull Requests

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-2026 The PHP Group
All rights reserved.
Last updated: Mon Jun 15 07:00:01 2026 UTC