Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^2: Permission denied error from dirmove function of File::Copy::Recursive.

by Gulliver (Monk)
on Jul 25, 2011 at 17:46 UTC ( [id://916569]=note: print w/replies, xml ) Need Help??


in reply to Re: Permission denied error from dirmove function of File::Copy::Recursive.
in thread Permission denied error from dirmove function of File::Copy::Recursive.

So instead of moving the directories I could copy them and then delete each file one at a time. Any file that can't be deleted I could use CreateFile to mark it to be deleted when closed.

Your link led me to GetSecurityInfo which can be used to get security information about a directory. If a delete directory failed I could get information about who has it open. It doesn't look like CreateFile will let me mark a directory for deletion. But I think I'm getting in a little over my head now.

From Creating and Deleting Directories:

To delete an existing directory, use the RemoveDirectory or RemoveDirectoryTransacted function. Before removing a directory, you must ensure that the directory is empty and that you have the delete access privilege for the directory. To do the latter, call the GetSecurityInfo function.

  • Comment on Re^2: Permission denied error from dirmove function of File::Copy::Recursive.

Replies are listed 'Best First'.
Re^3: Permission denied error from dirmove function of File::Copy::Recursive.
by ikegami (Patriarch) on Jul 25, 2011 at 18:42 UTC

    It doesn't look like CreateFile will let me mark a directory for deletion.

    I didn't see anything either, but that means you'll be left with empty directories at worse. Is that really so bad? They can get removed the next time around.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://916569]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (2)
As of 2025-12-05 22:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your view on AI coding assistants?





    Results (85 votes). Check out past polls.

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.