🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.pascal.delphi.misc
Article #481

Re: Problem writing to stdin of a console program (cvs.exe). Help?

#481
From: Jamie
Date: Wed, 21 Jan 2004 10:46
42 lines
3175 bytes
its most likely a protection of the password entry.
   you do not need to use the Io Stream to collect keyboard data.
  try looking at the keybd_event. look that up in the WIn32 Help.


Murray McCulloch wrote:
> I'm trying to control CVS from a GUI application. I have no trouble
> executing cvs.exe and collecting its output, but I've had no luck
> trying to send input to it when it prompts for a password (cvs logon
> command).
> 
> I'm creating a pipe and setting the hStdInput field of TStartupInfo to
> the read end before I create the process. Same thing with hStdOut and
> hStdIn (using a second pipe of course). Peeking at the stdout pipe, I
> see CVS's password prompt. But when I try to write to the stdin pipe,
> I get an invalid handle error. I've tried WriteFile(), WriteConsole()
> and WriteConsoleInput().
> 
> Another hint that something is wrong is that the CVS process seems to
> run away - CPU goes to 100% and the process doesn't end until I kill
> it. It's no surprise that it doesn't end, since it's waiting for
> input, but why the 100% CPU time?
> 
> I thought this might be something to do with the cvs.exe itself -- I
> read somewhere that not all programs are written in a way that they
> will allow you to redirect standard input. So I tried to write a
> simple console app of my own to test the theory, but I couldn't even
> get my own app to redirect output, let alone input. (It was a simple
> writeln/readln thing -- I guess I needed to do more?)
> 
> I've read tons of threads about redirecting output and input of
> console programs and tried everything I've read, but I cannot get
> cvs.exe to accept my input. If anyone has any thoughts about what I
> might be doing wrong, or happens to know if CVS just won't allow this
> (and if so, is there a work-around?), your replies would be greatly
> appreciated.
> 
> I've had the same results from both CVSNT and the bona fide CVS Win32
> binary.
> 
> Cheers,
> MM
Technical Details
Message-ID: <100sarbqjm7sv80@corp.supernews.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!sn-xit-03!sn-xit-04!sn-xit-06!sn-post-02!sn-post-01!supernews.com!corp.supernews.com!not-for-mail
References: <9fa254af.0401201526.601ef971@posting.google.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 1091e5,cf4a6cc472dc4b64
X-Google-Attributes: gid1091e5,public
X-Google-Thread: 10baee,cf4a6cc472dc4b64
X-Google-Attributes: gid10baee,public
X-Google-ArrivalTime: 2004-01-20 23:36:07 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!sn-xit-03!sn-xit-04!sn-xit-06!sn-post-02!sn-post-01!supernews.com!corp.supernews.com!not-for-mail
From: Jamie <jamie_5_not_valid_after_5@charter.net>
Newsgroups: comp.lang.pascal.delphi.misc,borland.public.delphi.winapi
Subject: Re: Problem writing to stdin of a console program (cvs.exe). Help?
Date: Wed, 21 Jan 2004 02:46:59 -0800
Organization: Posted via Supernews, http://www.supernews.com
Message-ID: <100sarbqjm7sv80@corp.supernews.com>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)
X-Accept-Language: en-us, en
MIME-Version: 1.0
References: <9fa254af.0401201526.601ef971@posting.google.com>
In-Reply-To: <9fa254af.0401201526.601ef971@posting.google.com>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: abuse@supernews.com
Lines: 43