The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Impossible to delete one folder

Discussion in 'General Discussion' started by Chronos, Feb 22, 2005.

  1. Chronos

    Chronos Registered

    Joined:
    Feb 22, 2005
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    I created for mistake a folder called test\\\aoi which is impossible to delete from the File Manager and from FTP.
    I cannot rename or change anything on that folder so its impossible to do anything with it.
    Is there a way to remove that folder from Cpanel?

    Thanks for help

    Chronos
     
  2. dgbaker

    dgbaker Well-Known Member
    PartnerNOC

    Joined:
    Sep 20, 2002
    Messages:
    2,578
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Toronto, Ontario Canada
    cPanel Access Level:
    DataCenter Provider
    As far as I know it would have to be removed through SSH. You may have to contact your host provider to have it removed.
     
  3. Rick_E

    Rick_E Registered

    Joined:
    Mar 5, 2005
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    The following PHP may delete your errant directory. Copy the following, substitute your misbehaving directory name, save it as a web page named deletedirectory.php, and upload to your web site. Then execute it by browsing to http://yourdomain.com/deletedirectory.php.

    You may need to paste the following code into notepad first to strip out extra formatting. Then select all and copy the code back out and paste into your web page.

    As always, it is good practice to back up your web site files first.


    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    </head>

    <body>
    <?php
    $directory='test\\\aoi';
    removedir($directory);

    function removedir($dir)
    {
    $dh=opendir($dir);
    while ($file=readdir($dh))
    {
    if($file!="." && $file!="..")
    {
    $fullpath=$dir."/".$file;
    if(!is_dir($fullpath))
    {
    unlink($fullpath);
    }else{
    removedir($fullpath);
    }
    }
    }
    closedir($dh);
    if(rmdir($dir))
    {
    return true;
    }else{
    return false;
    }
    }

    ?>
    </body>
    </html>
     
  4. K_aneda

    K_aneda Well-Known Member

    Joined:
    Feb 29, 2004
    Messages:
    56
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Sydney, Australia
    Could also try through FTP.
     
  5. AndyReed

    AndyReed Well-Known Member
    PartnerNOC

    Joined:
    May 29, 2004
    Messages:
    2,222
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Minneapolis, MN
    David is absolutely correct. SSH is the best method to delete a file/directory.
     
  6. K_aneda

    K_aneda Well-Known Member

    Joined:
    Feb 29, 2004
    Messages:
    56
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Sydney, Australia
    Yeah, but also have to look @ alternatives if SSH is not available - not every host will help out.
    However if SSH is disabled, could always lodge a support ticket to have it taken care of (that's if you don't own your own server)
     
  7. dgbaker

    dgbaker Well-Known Member
    PartnerNOC

    Joined:
    Sep 20, 2002
    Messages:
    2,578
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Toronto, Ontario Canada
    cPanel Access Level:
    DataCenter Provider
    If the format of the directory name is as Chronos says it is, then ssh is the only option.
     
  8. dr2web

    dr2web Active Member

    Joined:
    Jan 14, 2005
    Messages:
    33
    Likes Received:
    0
    Trophy Points:
    6
    If you can not do it from ftp or the file manager, as I see it the only options you would have is ssh, or the php code that was above, and quoted here...
     
Loading...

Share This Page