Would it be possible to steer clear of which Alan/Allen/Allan/Alen is which for 2.5 seconds, and I was getting confused as to where this thread was going?? I understand what NTDOC did, but yes explaining it for the masses who don't understand what I do now is a great benefit for this thread.
Back to post #171095
I just had another thought on your suggestion about the WRITELINEs I seem to be doing everywhere.
Would it be a better choice to open the logfile, and immediately below it use
PHP:
RedirectOutput($ARCHIVELOG)
and remove the WRITELINE commands? This would mean I could capture the output from Blat, RAR and UNRAR directly to the log file, as I think this would be served well in the file.
The benefits would be that if there are problems, then I can just comment out that line and see it on screen running it manually. Also the script would be smaller and easier to diagnose if problem turn up instead of having screen output and log file output seperately?
Ideas?
Pax
I got a comment confirming that RedirectOutput does mean nothing will appear on the console, which is fine as this will run as a scheduled task, BUT, is this the better method than having comments and errors echoing to screen, and again writing them to the file.
It would just down on the script size, and possible mean less errors as there is less code for me to leave out a rogue ",),; mark??
Pax
EDIT: Answered my own questions partially by trying it, but I still have the problem with redirecting RAR and UNRAR output as using >> tell me that it doesn't understand the command, so I'm exploring using the option -ierr which re-directs to STDERR.
It will need refining more, but I'll post here when I am happy enough for it to go into production.
Because I am trying to email the log file using blat, I have found that I have to do a RedirectOutput("") before emailing the file to close the file, otherwise the file cannot be accessed to it being help open. It is an issue with blat, but at least I can work around it.