In a Windows process I have I reopen STDOUT and STDERR redirected to an open 
file, for logging.  Fine so far.   An exception condition occurs for which I 
want to close the log file, but perl gives me this error on the attempted close:

Inappropriate IO control operation  

which seems to be the standard message for the kernel error ENOTTY.  

OK, so I assume that it's objecting to the fact that closing the file would 
leave STDOUT and STDERR no place to go, so I try reopening STDOUT and STDERR 
first without the redirect (and depending on perl's implicit close on reopen) , 
i.e. back to the TTY, and then closing the log file, but I get a SIGDIE and the 
same message on the first STDX reopen.   Seems to imply that the kernel doesn't 
have any TTY OUT handles for this process any longer or just perhaps that perl 
no longer has them?    

Is this a catch22 of STDX redirect in perl, i.e.  redirecting STDX is strictly 
a one-way street [at least on Windows], or is there a way out of this seeming 
dead-end so that I can successfully close the log file on the exception? 

TIA,
Jim Eshelman

_______________________________________________
Boston-pm mailing list
[email protected]
http://mail.pm.org/mailman/listinfo/boston-pm

Reply via email to