#1
  1. No Profile Picture
    Contributing User
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Jul 2003
    Posts
    3,466
    Rep Power
    594

    Remove_tree deletes content but not directory


    I am having trouble with remove_tree. While it deletes the contents of the directory, it does not delete the directory itself. I even explicitly set keep_root to 0.
    Code:
    remove_tree("/tmp/$number",{keep_root=>0});
    Is there some trick to this?
    There are 10 kinds of people in the world. Those that understand binary and those that don't.
  2. #2
  3. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2012
    Location
    spaceBAR Central
    Posts
    229
    Rep Power
    42
    Use the keys(error => \$err and result => \$res) to see what it is removing and to see if any errors occur(http://search.cpan.org/~dland/File-Path-2.08/Path.pm ).
    If you can not determine what is going on you can use the system command to run rm:

    Code:
    system( "rm -rf /tmp/$number" )

IMN logo majestic logo threadwatch logo seochat tools logo