#11214 [Ana->Csd]: Strange functionality of opendir/closedir functions?

From: Date: Mon, 29 Jul 2002 13:16:19 +0000
Subject: #11214 [Ana->Csd]: Strange functionality of opendir/closedir functions?
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-15489@lists.php.net to get a copy of this message
ID: 11214 Updated by: sfox@php.net Reported By: rac@whitestein.com -Status: Analyzed +Status: Closed Bug Type: Directory function related Operating System: WIN NT4.0 PHP Version: 4.3.0-dev New Comment: This bug has been fixed in CVS. You can grab a snapshot of the CVS version at http://snaps.php.net/. In case this was a documentation problem, the fix will show up soon at http://www.php.net/manual/. In case this was a PHP.net website problem, the change will show up on the PHP.net site and on the mirror sites. Thank you for the report, and for helping us make PHP better. Previous Comments: ------------------------------------------------------------------------ [2002-07-03 06:39:08] sfox@php.net This appears to be a rewinddir() problem afflicting ntfs only (still current in 4.3.0 dev). Looking into it. ------------------------------------------------------------------------ [2001-05-31 10:01:01] rac@whitestein.com $dh = opendir( "xxx" ); while( ($file = readdir( $dh )) !== false ) { // code } closedir( $dh ); rmdir( "xxx" ); --------------- Produces permission denied on WIN NT4.0. The command which actually ends up with permission denied is the rmdir() which should delete the directory. Sorry, I did not have time to check it out in new release of PHP (I'm using 4.0.3pl1) or under LINUX. The workaround I foud out to be working was this (looks like a problem of internal management of handles???): --------------- $dh = opendir( "xxx" ); while( ($file = readdir( $dh )) !== false ) { // code } closedir( $dh ); unset( $dh ); rmdir( "xxx" ); ------------------------------------------------------------------------ [2001-05-31 10:00:56] rac@whitestein.com $dh = opendir( "xxx" ); while( ($file = readdir( $dh )) !== false ) { // code } closedir( $dh ); rmdir( "xxx" ); --------------- Produces permission denied on WIN NT4.0. The command which actually ends up with permission denied is the rmdir() which should delete the directory. Sorry, I did not have time to check it out in new release of PHP (I'm using 4.0.3pl1) or under LINUX. The workaround I foud out to be working was this (looks like a problem of internal management of handles???): --------------- $dh = opendir( "xxx" ); while( ($file = readdir( $dh )) !== false ) { // code } closedir( $dh ); unset( $dh ); rmdir( "xxx" ); ------------------------------------------------------------------------ [2001-05-31 09:58:26] rac@whitestein.com $dh = opendir( "xxx" ); while( ($file = readdir( $dh )) !== false ) { // code } closedir( $dh ); rmdir( "xxx" ); --------------- Produces permission denied on WIN NT4.0. Sorry, I did not have time to check it out in new release of PHP (I'm using 4.0.3pl1) or under LINUX. The workaround I foud out to be working was this (looks like a problem of internal management of handles???): --------------- $dh = opendir( "xxx" ); while( ($file = readdir( $dh )) !== false ) { // code } closedir( $dh ); unset( $dh ); rmdir( "xxx" ); ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=11214&edit=1

« previous php.bugs (#15489) next »