DOCUMENT:Q69220 24-DEC-1999 [utilities] TITLE :BUG: Can't Redirect File as Input When Running a Program in PWB PRODUCT :Microsoft Programming Utilities PROD/VER:MS-DOS:1.0,1.1; OS/2:1.0,1.1 OPER/SYS: KEYWORDS:kb16bitonly ====================================================================== ------------------------------------------------------------------------------- The information in this article applies to: - Microsoft Programmer's Workbench for MS-DOS, versions 1.0, 1.1 - Microsoft Programmer's Workbench for OS/2, versions 1.0, 1.1 ------------------------------------------------------------------------------- SYMPTOMS ======== The Microsoft Programmer's WorkBench (PWB) contains three ways to run a program: 1. You can choose Execute from the Run menu (and choose Command Line from the Run menu to specify the command-line arguments). 2. You can choose Run DOS Command from the Run menu. 3. You can use the key combination "Arg textarg SHIFT+F9". However, a problem occurs if a file is redirected as input into a program that is executed using any of the methods above. The length of the input file, from which STDIN will receive data, will be erased and will receive a length of zero bytes. Thus, you cannot run a program (command) from the Programmer's WorkBench that expects STDIN to be redirected from a file. For example, if the command "PROG void main(void) { int c; for (c=getchar();!feof(stdin);c=getchar()) printf("%c",(char)c); } Additional query words: 1.00 1.10 buglist1.10 ====================================================================== Keywords : kb16bitonly Technology : kbAudDeveloper kbPWBSearch kbZNotKeyword3 kbPWB100DOS kbPWB110DOS kbPWB100OS2 kbPWB110OS2 Version : MS-DOS:1.0,1.1; OS/2:1.0,1.1 ============================================================================= THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY. Copyright Microsoft Corporation 1999.