php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #6908 rmdir fails after using dir()
Submitted: 2000-09-27 19:33 UTC Modified: 2001-02-20 07:53 UTC
From: rene dot mueller at datura dot ch Assigned:
Status: Closed Package: Directory function related
PHP Version: 4.0.2 OS: NT 4.0
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: rene dot mueller at datura dot ch
New email:
PHP Version: OS:

 

 [2000-09-27 19:33 UTC] rene dot mueller at datura dot ch
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>";

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-11-20 12:36 UTC] sniper@php.net
reclassify

 [2001-01-18 21:24 UTC] sniper@php.net
Does this happen with PHP 4.0.4pl1 ?

--Jani
 [2001-02-20 07:53 UTC] sniper@php.net
No feedback, considered fixed.

--Jani

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 09:01:30 2024 UTC