comp.lang.ada
 help / color / mirror / Atom feed
From: "Dave Head" <headdp@nswc.navy.mil>
Subject: Re: Using Spawn in Win2K
Date: Tue, 7 May 2002 16:02:16 -0400
Date: 2002-05-07T20:03:26+00:00	[thread overview]
Message-ID: <ab9bue$nm1$1@oanews.nswc.navy.mil> (raw)
In-Reply-To: udgb1hnacmmh49@corp.supernews.com


"Randy Brukardt" <randy@rrsoftware.com> wrote in message
news:udgb1hnacmmh49@corp.supernews.com...
> Dave Head wrote in message ...
> >Thanks.
> >
> >I did find CMD.  But this is going to make it more fun to produce
> something
> >for people with the different OS's and have it work the same...
> command.com
> >wants to give 8X3 filenames no matter what.  CMD does long filenames,
> no
> >problem, and by default too.
> >
> >It must be quitting time somewhere in the world...
>
> Trying to use "spawn" to get a list of files seems like killing a flea
> with a cannon.

I've been known to do that... I buy cars with big engines, too... <G>

 And, as you've found out, its not in the least portable
> (even to different versions of windows). There are lots of good uses for
> Spawn (or 'Prog_Call' as it is called in Janus/Ada, ...), but this isn't
> one of them.

OK.


> If you need to find a list of information about files in a directory,
> you are best off using a package designed for the purpose. The first
> choice would be Ada.Directories, but it probably will be a few years
> before that is generally available. But there are a lot of other choices
> available:


> -- Claw.Directories: Windows-specific. Works on any Ada compiler for
> Windows. (But it is tied into Claw, so if you're using a different GUI,
> or no GUI, it may be a bad choice.)

Isn't that tied to $$$.  And, no gui - its too simple - a GUI would be
overkill.

> -- Compiler-specific:
>    Gnat.Directories: Gnat-specific. Works (supposedly) on any Gnat
> supported OS. Every other Ada compiler has such a library as well.

Found G-direop.ads .. adb.  OK, but it appears as if one needs to

1) Open the directory (how to open the current directory?  Research here -
I'm just getting started with this.  Prolly Get_Current_Dir.  Yeah - duh...)
2) Use procedure Read in a loop until it finds the end, while
3) Storing each file name into the dos file I wanted.
4) Close the file

That is slightly more complicated.  I'll probably do it for the portability.
Thanks for the info.  I guess I didn't read g-direop.ads closely enough to
notice you could do that.  Of course, I approached it _wanting_ to do "dir/b
>XXX.XXX" which seemed awful simple at the time. <G>

> You also could use Florist or other of the other OS-interface packages.

Web search in order - just getting started with gnat/dos/windows and haven't
heard of these yet.

> Any of these choices would be less platform-specific than using Spawn.

Oh, yeah...  I'll likely stick with the gnat stuff, tho

Thanks again,

Dave Head

>
>             Randy Brukardt.






  reply	other threads:[~2002-05-07 20:02 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
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 [this message]
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