> -----Original Message-----
> 
> On Mon, 17 Apr 2006, Pettit, Paul wrote:
> > Just to show I'm not trying to do something arcane, here is the 
> > (simple) command I'm using:
> > 
> > unlink ($ticket_file_name) || &err_trap("Cannot delete
> > $ticket_file_name!\nMessage: $!\n");
> > 
> > With the above I get this:
> > 
> > Program error: Cannot delete C:/wwwdata/tickets/570439140! Message: 
> > Permission denied
> 
> The 2 most common reasons for this are:
> 
> 1) Some process still has an open handle for this file.  You 
> cannot delete
>    open files on Windows.  You can rename them if you need to 
> reuse the
>    the filename immediately, but you cannot delete them until 
> all processes
>    have close all open handles for this file.
> 
> 2) The file is marked read-only.  You cannot unlink read-only files on
>    Windows.  This is easy to fix though, you can just 
> chmod(0666, $file)
>    before calling unlink($file).
> 
> Cheers,
> -Jan
> 
> --------------------------------------
> 
> Also, unlink does not work reliably (in some cases at all) on 
> windows unless
> the complete file path is used.
> 
> - Chris
> 
> 

Thanks all.

File paths are complete paths (not relative or simple) so that wasn't the
issue. Indeed it was reason #1 that was the culprit. 

I knew it had to be something simple I was missing. Seems the coding was a
bit sloppy and the Win box didn't like it.

Time to sit down and do that code revision I think. :P

Thanks again for pointing me in the right direction guys.

Paul Pettit
CTO and IS Manager
Consistent Computer Bargains Inc.

I've heard it said that the proof of lunacy is when you repeat the same
steps expecting different results.  I say it's proof that you're a Microsoft
user. - comment by deshi777 on experts-exchange.com


_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to