comp.lang.ada
 help / color / mirror / Atom feed
From: "Marin David Condic" <dont.bother.mcondic.auntie.spam@[acm.org>
Subject: Re: Ada binding to redirect standard output in Win32
Date: Mon, 1 Oct 2001 09:25:41 -0400
Date: 2001-10-01T13:25:43+00:00	[thread overview]
Message-ID: <9p9qsn$64f$1@nh.pace.co.uk> (raw)
In-Reply-To: 3bb82d8e$1@pull.gecm.com

I don't know if it works on MS-DOS, but its something that comes with Gnat &
may be half-way portable. Perform a system command doing something like the
following: (You may need to modify this for MS-DOS-isms rather than
Unix-isms, but IIRC, there is a "system" C call that works for MS-DOS.)

with Interfaces.C;

procedure UTIL.Perform_System_Command (
    Command     : in     String ;
    Wait        : in     Boolean := True ;
    Success     :    out Boolean) is
    --
    Return_Code : Integer ;
    --
    function Sys (
        Item    : in     Interfaces.C.Char_Array) return Integer ;
    pragma Import (C, Sys, "system") ;
    --
    package C renames Interfaces.C ;
    --
begin
    --
    if (Wait) then
        Return_Code := Sys (
            Item    => C.To_C ("ksh -c " & '"' & Command & '"'));
    else
        Return_Code := Sys (
            Item    => C.To_C ("ksh -c " & '"' & Command & " &" & '"'));
    end if ;
    --
    if (Return_Code /= 0) then
        Success := False ;
    else
        Success := True ;
    end if;
    --
end UTIL.Perform_System_Command ;


MDC
--
Marin David Condic
Senior Software Engineer
Pace Micro Technology Americas    www.pacemicro.com
Enabling the digital revolution
e-Mail:    marin.condic@pacemicro.com
Web:      http://www.mcondic.com/

"Martin Dowie" <martin.dowie@nospam.baesystems.com> wrote in message
news:3bb82d8e$1@pull.gecm.com...
> I have a Win32 (non-GUI) program which requires the user
> to type in their password but, for obvious reasons, I
> don't want it to appear on the screen/DOS window as
> they type.
>
> Does anyone have an Ada binding to a routine similar in
> effect to 'ECHO OFF' that I could call before the
> 'Get_Line'? or, something similar to redirecting the
> standard output to a UNIX null device.
>
> I've exhausted my search engine enough on this! :-)
>
> Thanks in advance...
>
>
>





      parent reply	other threads:[~2001-10-01 13:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-10-01  8:59 Ada binding to redirect standard output in Win32 Martin Dowie
2001-10-01 12:35 ` Chad Robert Meiners
2001-10-01 13:44   ` Martin Dowie
2001-10-01 13:25 ` Marin David Condic [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox