comp.lang.ada
 help / color / mirror / Atom feed
From: "Dave Head" <headdp@nswc.navy.mil>
Subject: Using Spawn in Win2K
Date: Mon, 6 May 2002 16:44:01 -0400
Date: 2002-05-06T20:45:09+00:00	[thread overview]
Message-ID: <ab6q0l$4g6$1@oanews.nswc.navy.mil> (raw)

Hello,

I have been trying to use spawn just to get it to give me a directory.
Someday, if I ever get a directory, I might like to pipe it to a file.  But,
first things first.

I've been wasting an incredible amount of time tripping thru about 10 years
of google newsgroup posts viewing people asking about spawn with as many
years of creative ways of not anwering the question.  What I'm looking for
is a specific example.  Here's what I have so far:

with GNAT.OS_Lib;

procedure test_OSLib is

Success : BOOLEAN;
Cmd : String := "Dir";
Cmd_ptr : GNAT.OS_Lib.String_Access;
Cmd_array : GNAT.OS_Lib.Argument_List(1..1);

begin

    Cmd_ptr := new String'(Cmd);
    Cmd_array(1) := Cmd_ptr;
    GNAT.OS_Lib.Spawn
        ("Command.Com",
          Cmd_array,
          Success);

end test_OSLib;

...And this is the response:


Specified COMMAND search directory bad
Microsoft(R) Windows DOS
(C)Copyright Microsoft Corp 1990-1999.

Howcum?  Because, as far as a search of the C: drive can tell, there is no
"command.com" on the disk. Again, this is W2K.

So, please, what goes where I have "command.com"?  Or, can it be done at all
in W2K?  Later, when that is working, and I want to say "dir >filename.txt"
to throw the output into a file, can the entire phrase "dir >XXX.XXX" be
thrown into the string, or do each of "dir", ">" and "XXX" have to be a
different string for the Cmd_array to point to?

Thanks in advance,

Dave Head





             reply	other threads:[~2002-05-06 20:44 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-05-06 20:44 Dave Head [this message]
2002-05-06 21:05 ` Using Spawn in Win2K Dave Head
2002-05-06 23:42   ` Jeffrey Carter
2002-05-07  0:41     ` DPH
2002-05-07  1:47       ` David C. Hoos, Sr.
2002-05-07  8:23         ` DPH
2002-05-06 21:49 ` Stephen Leake
2002-05-07 17:06 ` Björn Lundin
2002-05-07 17:36   ` Dave Head
2002-05-07 19:34     ` Randy Brukardt
2002-05-07 20:02       ` Dave Head
2002-05-07 23:23         ` Randy Brukardt
replies disabled

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