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


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

Reply via email to