Search the FAQ Archives

3 - 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
faqs.org - Internet FAQ Archives

comp.os.msdos.programmer FAQ part 2/5
Section - - How can I tell if input, output, or stderr has been redirected?

( Part1 - Part2 - Part3 - Part4 - Part5 - Single Page )
[ Usenet FAQs | Web FAQs | Documents | RFC Index | Zip codes ]


Top Document: comp.os.msdos.programmer FAQ part 2/5
Previous Document: - How can my program tell what kind of keyboard is on the system?
Next Document: - How can I increase the size of the keyboard buffer?
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:

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: - How can my program tell what kind of keyboard is on the system?
Next Document: - How can I increase the size of the keyboard buffer?

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