Correction: 'Anton'#13#10 is read from stdout. More adds the CR. Windows style EOL ...
Ludo -----Message d'origine----- De : fpc-pascal-boun...@lists.freepascal.org [mailto:fpc-pascal-boun...@lists.freepascal.org] De la part de Ludo Brands Envoyé : dimanche 8 mai 2011 19:06 À : 'FPC-Pascal users discussions' Objet : RE : [fpc-pascal] Redirecting input to a child process If you run 'more' in a cmd window you'll notice that 'more' echoes the input but only sends to stdout when a return is entered. I modified the program to send 'Anton'#10 and the program reads back 'Anton'#10 from stdout. Ludo -----Message d'origine----- De : fpc-pascal-boun...@lists.freepascal.org [mailto:fpc-pascal-boun...@lists.freepascal.org] De la part de Marco van de Voort Envoyé : dimanche 8 mai 2011 18:06 À : FPC-Pascal users discussions Objet : Re: [fpc-pascal] Redirecting input to a child process In our previous episode, Anton Shepelev said: > > > shell, isn't the shell's input redirected to the program's? > > > > Maybe. I'm pretty sure about batchfiles, but never > > tried programs, that's why I thought I'd mention > > the observation. > > My program captures both the standard and error out- > put of batchfiles and progams called therefrom just > the same way as with regular programs run using the > shell. > > So you don't see any evident errors? I played a bit with it, but was unable to make it work. I added a writeln of outstream.size to the "running" while, and it seems output is written. It seems the program somehow doesn't get the signal to close. (since I can see more.com is still running in the taskmgr) _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal