![]() |
|
Just another Perl shrine | |
PerlMonks |
Permission denied error from dirmove function of File::Copy::Recursive.by Gulliver (Monk) |
on Jul 22, 2011 at 18:43 UTC ( [id://916189]=perlquestion: print w/replies, xml ) | Need Help?? |
Gulliver has asked for the wisdom of the Perl Monks concerning the following question: I have written a Perl application that downloads several directories to a temporary download folder before doing some operations and then moving subfolders from the download folder to various locations. The problem is that other people browse through the download folder during the ftp transfer and occasionally cause the dirmove function to fail. The download folder gets created with a timestamp ( 12 digits in the actual application) so it is unique and easy to find if something goes wrong. I read about flock but it doesn't seem to work for directories when I tried it. I'm thinking about setting the hidden bit (Windows 2008 server) during the download. I already have a function that is triggered by __DIE__ so I could unhide it if something happens. The code below allowed me to recreate the problem. I found if I opened the directory in Windows Explorer then there was no error. If I opened the file with Notepad at the target location my script would move the file but then die without moving the directory. By changing to the directory in a command prompt before the dirmove then I get the "Permission Denied" error and nothing is moved. Has anyone else dealt with this? Any suggestions?
Results in this:
Back to
Seekers of Perl Wisdom
|
|