Delete ftp-folder created via php installation?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Alf Laue

    Delete ftp-folder created via php installation?

    Hi,

    how do I delete a folder at my ftp-server, that was automatically
    created through a installation script? I dont have the permission to
    delete that folder :-(

    Thx for your help

    Alf

    P.S.
    I have already found the following script, but I dont know where exactly
    do I need to execute it:

    ---------------------------------------------------
    <?php
    function delete($file) {
    chmod($file,077 7);
    if (is_dir($file)) {
    $handle = opendir($file);
    while($filename = readdir($handle )) {
    if ($filename != "." && $filename != "..") {
    delete($file."/".$filename );
    }
    }
    closedir($handl e);
    rmdir($file);
    } else {
    unlink($file);
    }
    }

    delete("folderr name");
    -------------------------------------------------

    ....whereas foldername at the end is the folder to be deleted.
    ?>
  • Janwillem Borleffs

    #2
    Re: Delete ftp-folder created via php installation?

    Alf Laue wrote:[color=blue]
    > how do I delete a folder at my ftp-server, that was automatically
    > created through a installation script? I dont have the permission to
    > delete that folder :-(
    >[/color]

    When the site is hosted on a *nix server, the easiest way to remove the
    folder is through exec():

    exec('rm -r foldername');


    JW



    Comment

    • noSpam

      #3
      Re: Delete ftp-folder created via php installation?

      Janwillem Borleffs wrote:[color=blue]
      > Alf Laue wrote:
      >[color=green]
      >>how do I delete a folder at my ftp-server, that was automatically
      >>created through a installation script? I dont have the permission to
      >>delete that folder :-(
      >>[/color]
      >
      >
      > When the site is hosted on a *nix server, the easiest way to remove the
      > folder is through exec():
      >
      > exec('rm -r foldername');
      >
      >
      > JW
      >
      >
      >[/color]
      just because your ISP has set up an ftp directory doesn't mean you have
      to use it - just let it sit there.

      Comment

      • Andrew Dunn

        #4
        Re: Delete ftp-folder created via php installation?

        here is what i use
        <?
        $path = '/path/to/folder/;

        $cmd = "rm -rf $path";

        `$cmd`;

        ?>

        "noSpam" <garbage@nowher e.qwerty.no.spa m.address.com> wrote in message
        news:PxYQd.6498 5$68.39070@fe1. news.blueyonder .co.uk...[color=blue]
        > Janwillem Borleffs wrote:[color=green]
        >> Alf Laue wrote:
        >>[color=darkred]
        >>>how do I delete a folder at my ftp-server, that was automatically
        >>>created through a installation script? I dont have the permission to
        >>>delete that folder :-(
        >>>[/color]
        >>
        >>
        >> When the site is hosted on a *nix server, the easiest way to remove the
        >> folder is through exec():
        >>
        >> exec('rm -r foldername');
        >>
        >>
        >> JW
        >>
        >>
        >>[/color]
        > just because your ISP has set up an ftp directory doesn't mean you have to
        > use it - just let it sit there.[/color]


        Comment

        Working...