comp.lang.ada
 help / color / mirror / Atom feed
From: "Dave Head" <headdp@nswc.navy.mil>
Subject: Re: Using Spawn in Win2K
Date: Mon, 6 May 2002 17:05:03 -0400
Date: 2002-05-06T21:06:12+00:00	[thread overview]
Message-ID: <ab6r84$4nn$1@oanews.nswc.navy.mil> (raw)
In-Reply-To: ab6q0l$4g6$1@oanews.nswc.navy.mil

Further info...  I _found_ command.com under c:\winnt\system32.  Why wasn't
it found in the search starting at c:\?  I dunno - prolly misspelt it.  But,
I put the whole path into the spawn for the command. Same result.  So, not
only don't I know how to get it working, I've got nary a clue as to why it
doesn't.

Please help.

Dave Head


"Dave Head" <headdp@nswc.navy.mil> wrote in message
news:ab6q0l$4g6$1@oanews.nswc.navy.mil...
> 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 21:05 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-05-06 20:44 Using Spawn in Win2K Dave Head
2002-05-06 21:05 ` Dave Head [this message]
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