[PHP-DEV] PHP 4.0 Bug #6908: rmdir fails after using dir() From: rene.mueller <email protected>
Date: 09/27/00

From: rene.mueller <email protected>
Operating system: NT 4.0
PHP version: 4.0.2
PHP Bug Type: *Directory/Filesystem functions
Bug description: rmdir fails after using dir()

the following sequence fails at rmdir() with permission denied as long as we uncomment the $d-part.

Wa are not very shure if it's a problem of the code somehow or a bug.

Thanks for any answers.

/*
  $d = dir( "./temp/sess_".session_id() );
  while( $entry = $d->read() )
  {
    if ( $entry != "" && $entry != "." && $entry != ".." )
    {
      $fn = $d->path."/".$entry;
      unlink( $fn );
    }
  }
  $d->close();

  echo "all files deleted <br>";
*/

  $canonical_dir = str_replace( "\\", "/", $PATH_TRANSLATED );
  $canonical_dir = substr( $canonical_dir, 0, strrpos( $canonical_dir, "/" ) );
  $canonical_dir = $canonical_dir."/temp/sess_".session_id();

  echo "dirname : " . $canonical_dir . "<br>";

  rmdir( $canonical_dir );

  echo "directory removed <br>";

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: php-dev-unsubscribe <email protected>
For additional commands, e-mail: php-dev-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>