Mark, you are correct it would help if I had closed the file handles. That is what I get for trusting a friend's code, and not reviewing all it when I add it to my project.
Thanks for your help. Tim Donahue On Fri, 2004-09-10 at 15:05, [EMAIL PROTECTED] wrote: > Tim, > You should close your file handles in your parsing code, before you unlink > hth, > Mark G > > ----- Original Message ----- > From: Tim Donahue <[EMAIL PROTECTED]> > Date: Friday, September 10, 2004 2:58 pm > Subject: Removing a tempdir's on Windows > > > Hello, I am writing a custom log parser for our Squid proxy, and I > > haverun into some problems with trying to use a temporary > > directory. The > > script parses all the logs, dumping those that are of interest to > > us for > > the various parts of the report to smaller, easier to handle > > files. I > > am using the following statement to create a temporary directory which > > works out great, removing most of the files, unfortunately I can not > > seem to make it remove all the files. > > > > our $templogs_base = 'C:\squid\var\log\SquidLog'; > > our $templogs = tempdir( DIR => $templogs_base, CLEANUP => 1 ); > > > > > > When I run the script, I get the following errors: > > > > Can't unlink file C:\squid\var\log\SquidLog\5FIwr0r4nz/tmp- > > stb.com.txt: Permission denied at C:/SFU/Perl/lib/File/Temp.pm > > line 845 > > Can't remove directory C:\squid\var\log\SquidLog\5FIwr0r4nz: > > Directory not empty at C:/SFU/Perl/lib/File/Temp.pm line 845 > > > > I have thought about manually running unlink on all the files > > contained > > within that directory, however that seems like an ugly kludge to force > > the removal of the temporary directory. > > > > Can anyone shed some light on a clean way to do this? > > > > Tim Donahue > > > > > > > > -- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > <http://learn.perl.org/> <http://learn.perl.org/first-response> > > > > > > > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>