comp.lang.ada
 help / color / mirror / Atom feed
* Using Spawn in Win2K
@ 2002-05-06 20:44 Dave Head
  2002-05-06 21:05 ` Dave Head
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Dave Head @ 2002-05-06 20:44 UTC (permalink / 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





^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2002-05-07 23:23 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-05-06 20:44 Using Spawn in Win2K Dave Head
2002-05-06 21:05 ` 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

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