Web Analytics Made Easy -
StatCounter deleteing directories - CodingForum

Announcement

Collapse
No announcement yet.

deleteing directories

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • deleteing directories

    How can I delete files that were made by the server in ftp? Everytime I try I get "Permission denied". Do I have to delete them by a script or something? I've tried everything I can think of. Changing permissions, changing chmod, etc

  • #2
    yes you will need to use a script to delete the files , or change the ownership of the files, & since some hosts wont let you CHOWN then deletion is probably easiest.

    <?
    unlink('filename.file');
    ?>
    resistance is...

    MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)

    Comment


    • #3
      oops, I meant a whole directory, which has loads of other directories, not files.

      Comment


      • #4
        I've tried renaming and unlinking, both come up with permission denied.

        Warning: Rename failed (Permission denied) in /home/chatterspics/public_html/clear.php on line 3

        The directories are chmoded to 777, if that helps

        Comment


        • #5
          www.php.net/rmdir

          Try that

          Jee
          Jeewhizz - MySQL Moderator
          http://www.sitehq.co.uk
          PHP and MySQL Hosting

          Comment


          • #6
            I guess You probably need to have all files in your directory to be correctly chmodded...
            I don't suffer from insanity, I enjoy every single minute of it!

            Comment


            • #7
              hmmm OK - you can try this BUT BE VERY CAREFUL!!!!!

              exec('rm -f -R thisdirectory');

              and I mean careful cos if you get this wrong you get it wrong bigtime! that should remove the directory and all its contents including subdirectories.

              again BE CAREFUL !!
              resistance is...

              MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)

              Comment


              • #8
                Ok, I execute that in the directory I want to delete, or name "thisdirectory" to the directory I want to delete? I don't wanna mess it up :s

                Comment


                • #9
                  That didn't delete anything :s

                  Comment


                  • #10
                    Just trie everything on this page

                    http://www.php.net/manual/en/function.rmdir.php

                    Nothing worked.

                    Comment


                    • #11
                      My host told me that this has to do with the PHP script not "running as user". They say that you want to use a perl script to perform these kinds of operations (especially if you dont want the directory to have universal write access). Does this make sense? Is it possible to call a perl script from a php script in order to perform some of these sensitive operations, or is that a mistake?

                      G

                      Comment


                      • #12
                        I finally got this to work. Again, on my host, php does not run with the authority needed to do deletes, renames, etc. So in my php script, I set up a call to a cgi written in perl that handles those actions. It works.

                        G

                        Comment

                        Working...
                        X