Last updated 2004-06-28 by Roedy
Green ©1996-2004 Canadian Mind Products
Java definitions: 0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
You are here : home : Java Glossary : 0-9 words : 4NT.
4NTIt is initially of interest to Java programmers because it lets you redirect both STDOUT and STDERR to files, pipes or tees. The feature allows you to redirect the output of javac.exe, i.e. the error messages, which appear on STDERR, to a file, or to both a file and the console. Why is that important? Capturing the error messages from javac.exe can be a hassle since they scroll off the screen faster than you can read them. Ordinary > redirection won't capture them to a file because they are going to STDERR, not STDOUT.
Once you have 4NT installed you can type:
javac.exe *.java >& err.log
Both STDOUT and STDERR stuff will go to the err.log file. You might write something like this:
javac.exe *.java |& more
This pipes both the STDOUT and STDERR stuff to the more utility which will display it an page at a time. For fine control you can write something like this:
javac.exe *.java 1>err1.log 2>err2.log
This sends STDOUT stuff to the err1.log file, and STDERR stuff to the err2.log file. If you want the STDERR and STDOUT stuff to go both to a file and to the console you could write:
javac.exe *.java |& tee err.log |& more
When using tee with a pipe under 4NT, the programs on the two ends of the pipe run simultaneously, not sequentially as in 4DOS. This means more starts producing output right away. It does not need to wait until the compile finishes.
You can play with timestamps (improperly called ages) like this:
REM if myfile.java is newer than myfile.exe, REM i.e. has a bigger timestamp, REM then recompile. REM note lack of () around if expression, and [] around parms. if %@FILEAGE[myfile.java] GT %@FILEAGE[myfile.exe] call recompile file
There is a version of 4NT for windows called 4DOS.
I have encountered only one bug: CDD /S DE will not work unless a C: drive exists. You can work around that by providing it with a dummy one with SUBST C: D:\
You can install it as your official command processor with by setting the COMSPEC envirnonment variable to: C:\4NT401\4NT.EXE /E:2500 /C.
home |
Canadian Mind Products | |||
| mindprod.com IP:[24.87.56.253] | ||||
| Your IP:[80.134.30.163] | ||||
| You are visitor number 2606. | ||||
| Please send errors, omissions and suggestions | ||||
| to improve this page to Roedy Green. | ||||
| You can get a fresh copy of this page from: | or possibly from your local J: drive mirror: | |||
| http://mindprod.com/jgloss/fornt.html | J:\mindprod\jgloss\fornt.html | |||