in reply to rmtree() is failing after some time

Could be a permissions issue. Check $!, or you might have to run your script under strace or truss (if you have them) to get the real error.
  • Comment on Re: rmtree() is failing after some time

Replies are listed 'Best First'.
Re^2: rmtree() is failing after some time
by KristinaBurden (Initiate) on Apr 23, 2009 at 12:00 UTC
    I am a newbie in Perl. What is strace or truss? Point here is that rmtree() is able to delete temp folders initially but after some time it starts giving this error. And I restart my perl program then also, initially it is able to delete them but after 20-25 folders it starts giving error. My perl program creates threads(8-10), each thread creates a temp folder, processes it and then deletes it. Initially all threads behave well. After some time, error starts appearing.

      See strace/truss. It's a runtime call monitor for Perl, to find out where the problem is.

      failed to fetch initial working directory

      Is this the exact error message you get? I have a feeling that it's an issue with threading (you didn't mention in your post you use threads). Maybe you should post more code so we can take a look at it.

        I am calling rmtree() in DESTROY() method of a class. Here is the exact error message Thu Apr 23 18:08:24 2009 - WARN: cannot fetch initial working directory: No such file or directory at Basecamp/Setup.pm line 265 thread 6 Code is scattered in different files so I am not able to post more code.
        Thu Apr 23 18:02:04 2009 - WARN: cannot fetch initial working directory: No such file or directory at Basecamp/Setup.pm line 265 thread 8
        This is the exact error message that I get.

        Actually my code is scattered in many files, so I am not able to post more code.
        I am calling rmtree() in DESTROY() method of a class.