in reply to Re: Moving directories on Win32
in thread Moving directories on Win32

The error message is..."Permission denied"...even though the move is going up one directory to my own desktop.

I can manually make that same move, no problem. The script can mkdir to there, write a *.txt to there, just not move a directory there.

Replies are listed 'Best First'.
Re^3: Moving directories on Win32
by BrowserUk (Patriarch) on Nov 28, 2007 at 21:06 UTC

    Whenever you use a OS call and check for failure it is as well to display $^E as well (or instead of) $!. In this case, you would get the following:

    warn $!; Permission denied warn $^E The process cannot access the file because it is being used by another + process

    Which makes identifying the problem easier, if not the solution.


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.
Re^3: Moving directories on Win32
by wind (Priest) on Nov 28, 2007 at 18:50 UTC
    Well, if you can mkdir the directory that you're trying to move to then I'm guessing you're most likely dealing with a locking issue for your source directory. Do you have window opened to that directory, or even a text editor with that directory as the last opened location?

    Try closing all extra programs and rerun the script. From outside the source directory of course. :)

    If all else fails, you could play around with File::Find to create your own 1 to 1 recursive move function. It would also probably fail at some point, but you would find the exact file or directory that is being locked that way.

    - Miller