|
Top Document: comp.os.msdos.programmer FAQ part 2/5 Previous Document: Next Document: See reader questions & answers on this topic! - Help others by sharing your knowledge Date: 8 Feb 2002 19:49:17 -0400 Normally, input and output are associated with the console (i.e., with the keyboard and the screen, respectively). If either is not, you know that it has been redirected. Some source code to check this is available at the usual archive sites. Timo Salmi has created a collection of Turbo Pascal units, one of which can be used to detect such redirection. These can be downloaded from <http://garbo.uwasa.fi/pc/ts.html>. The files you are looking for have names of the format tspaVV??.zip where the VV is the current version and ?? is 70, 60, 55, 50, or 40 for Turbo Pascal 7.0, 6.0, 5.5, 5.0, or 4.0 respectively.) Source code is not included. Also see the downloadable Frequently Asked Questions files by Timo Salmi: <ftp://garbo.uwasa.fi/pc/link/> If you program in C, use isatty() if your implementation has it. Good references for the principles are PC Magazine 16 Apr 1991 (x: 7) page 374; Ray Duncan's {Advanced MS-DOS}, ISBN 1-55615-157-8, or Ralf Brown's interrupt list (<Q:02.03> [What and where is Ralf Brown's interrupt list?]) for INT 21 AX=4400; and Terry Dettman and Jim Kyle's {DOS Programmer's Reference: 2d edition}, ISBN 0-88022-458-4, pages 602-603. User Contributions: 1 Ben in Seattle ⚠ Jun 2, 2026 @ 4:16 pm Another solution is to use a parallel port loopback plug. It makes the PC think there is a printer attached. The benefit of this is it doesn't require anticipating the problem with ANSI.SYS escape sequences nor does it make you wait half an hour for the "Abort, Retry, Ignore?" prompt, as some versions of DOS do. Comment about this article, ask questions, or add new information about this topic:Top Document: comp.os.msdos.programmer FAQ part 2/5 Previous Document: Next Document: Part1 - Part2 - Part3 - Part4 - Part5 - Single Page [ Usenet FAQs | Web FAQs | Documents | RFC Index ] Send corrections/additions to the FAQ Maintainer: jeffrey@carlyle.org (Jeffrey Carlyle)
Last Update March 27 2014 @ 02:11 PM
|
