comp.lang.ada
 help / color / mirror / Atom feed
* Directory Listing
@ 2003-01-14 21:02 Rick Selby
  2003-01-14 21:41 ` Jacob Sparre Andersen
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Rick Selby @ 2003-01-14 21:02 UTC (permalink / raw)


Hi,

I've been searching around for a solution to this for a while, and finally
remembered about newsgroups...

Basically I'd like a program that I can run in a directory, that will be
able to read in the names of the files in the directory, do stuff with them,
then create some directories and move the files around.

Obviously the 'doing stuff with them' bit I know I can do... but is anything
else remotely possible in Ada? I'd like to use Ada because, well, I know it,
and although I'm pretty sure it could be done in C I haven't the foggiest
where to start there.

And I think I remember a command to run dos programs, so the creating
directories and moving files seems reasonable, if only I knew what the file
names were...

Oh I'm running under Windows with Gnat.

Cheers,
--Rick





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

* Re: Directory Listing
  2003-01-14 21:02 Directory Listing Rick Selby
@ 2003-01-14 21:41 ` Jacob Sparre Andersen
  2003-01-14 21:44 ` Stephen Leake
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 9+ messages in thread
From: Jacob Sparre Andersen @ 2003-01-14 21:41 UTC (permalink / raw)


Rick Selby wrote:

> Basically I'd like a program that I can run in a directory, that will be
> able to read in the names of the files in the directory, do stuff with them,
> then create some directories and move the files around.

Since you are using GNAT, you could take a look at the 
package GNAT.OS_Lib.  If you want a more general solution, 
you should use a POSIX library (Florist is one option).

Greetings,

Jacob
-- 
"In space, no-one can press CTRL-ALT-DEL"
                                         -- An Ada programmer




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

* Re: Directory Listing
  2003-01-14 21:02 Directory Listing Rick Selby
  2003-01-14 21:41 ` Jacob Sparre Andersen
@ 2003-01-14 21:44 ` Stephen Leake
  2003-01-15  4:50   ` Eric G. Miller
  2003-01-14 21:47 ` sk
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 9+ messages in thread
From: Stephen Leake @ 2003-01-14 21:44 UTC (permalink / raw)


"Rick Selby" <rjs130@york.ac.uk> writes:

> Basically I'd like a program that I can run in a directory, that will be
> able to read in the names of the files in the directory, do stuff with them,
> then create some directories and move the files around.
> 
> Oh I'm running under Windows with Gnat.

See the packages GNAT.OS_Lib and GNAT.Directory_Operations. You can
find the package specs in
GNAT/lib/gcc-lib/pentium-mingw32msv/2.8.1/adainclude/ 

It would be nice if the GNAT user's guide had a list of these useful
libraries, but it doesn't. There are lots more there ...

-- 
-- Stephe



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

* Re: Directory Listing
  2003-01-14 21:02 Directory Listing Rick Selby
  2003-01-14 21:41 ` Jacob Sparre Andersen
  2003-01-14 21:44 ` Stephen Leake
@ 2003-01-14 21:47 ` sk
  2003-01-15 12:30 ` Rick Selby
  2003-01-17  2:28 ` R. Srinivasan
  4 siblings, 0 replies; 9+ messages in thread
From: sk @ 2003-01-14 21:47 UTC (permalink / raw)


Hi,

 > Oh I'm running under Windows with Gnat.

Gnat.Os_Lib, Gnat.Directory_Operations, Gnat.Io_Aux

(I use Linux, but I believe that the Windows versions
provide the same interface).

-- 
--
-- Merge vertically for real address
--
------------------------------------
-- s n p @ t . o
--  k i e k c c m
------------------------------------




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

* Re: Directory Listing
  2003-01-14 21:44 ` Stephen Leake
@ 2003-01-15  4:50   ` Eric G. Miller
  2003-01-15 14:55     ` Stephen Leake
  0 siblings, 1 reply; 9+ messages in thread
From: Eric G. Miller @ 2003-01-15  4:50 UTC (permalink / raw)


In article <ubs2jh0ee.fsf@nasa.gov>, Stephen Leake wrote:
> "Rick Selby" <rjs130@york.ac.uk> writes:
> 
>> Basically I'd like a program that I can run in a directory, that will be
>> able to read in the names of the files in the directory, do stuff with them,
>> then create some directories and move the files around.
>> 
>> Oh I'm running under Windows with Gnat.
> 
> See the packages GNAT.OS_Lib and GNAT.Directory_Operations. You can
> find the package specs in
> GNAT/lib/gcc-lib/pentium-mingw32msv/2.8.1/adainclude/ 
> 
> It would be nice if the GNAT user's guide had a list of these useful
> libraries, but it doesn't. There are lots more there ...

Over here, "info gnat-rm" contains a section titled "The GNAT Library" 
that gives a very terse description of each unit.  (gcc 3.2)  But,
somehow the info ARM manual got "lost" ;-(

-- 
echo ">gra.fcw@2ztr< eryyvZ .T pveR" | rot13 | reverse



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

* Re: Directory Listing
@ 2003-01-15  6:06 Grein, Christoph
  0 siblings, 0 replies; 9+ messages in thread
From: Grein, Christoph @ 2003-01-15  6:06 UTC (permalink / raw)


> See the packages GNAT.OS_Lib and GNAT.Directory_Operations. You can
> find the package specs in
> GNAT/lib/gcc-lib/pentium-mingw32msv/2.8.1/adainclude/ 
> 
> It would be nice if the GNAT user's guide had a list of these useful
> libraries, but it doesn't. There are lots more there ...

The top secret Gnat Reference Manual has this list.



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

* Re: Directory Listing
  2003-01-14 21:02 Directory Listing Rick Selby
                   ` (2 preceding siblings ...)
  2003-01-14 21:47 ` sk
@ 2003-01-15 12:30 ` Rick Selby
  2003-01-17  2:28 ` R. Srinivasan
  4 siblings, 0 replies; 9+ messages in thread
From: Rick Selby @ 2003-01-15 12:30 UTC (permalink / raw)


Thankyou all for pointing me there, all a success too!

Cheers,
--Rick





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

* Re: Directory Listing
  2003-01-15  4:50   ` Eric G. Miller
@ 2003-01-15 14:55     ` Stephen Leake
  0 siblings, 0 replies; 9+ messages in thread
From: Stephen Leake @ 2003-01-15 14:55 UTC (permalink / raw)


"Eric G. Miller" <felix@calico.local> writes:

> In article <ubs2jh0ee.fsf@nasa.gov>, Stephen Leake wrote:
> > It would be nice if the GNAT user's guide had a list of these useful
> > libraries, but it doesn't. There are lots more there ...
> 
> Over here, "info gnat-rm" contains a section titled "The GNAT Library" 
> that gives a very terse description of each unit.  (gcc 3.2)  But,
> somehow the info ARM manual got "lost" ;-(

Ah. The ACT distribution of GNAT also has the list of GNAT-specific
packages in the GNAT Reference Manual (along with the list of Ada
standard packages). I had been looking in the GNAT User Guide, since
I thought the reference manual only contained stuff required by the
Ada language standard. Oh well ...

-- 
-- Stephe



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

* Re: Directory Listing
  2003-01-14 21:02 Directory Listing Rick Selby
                   ` (3 preceding siblings ...)
  2003-01-15 12:30 ` Rick Selby
@ 2003-01-17  2:28 ` R. Srinivasan
  4 siblings, 0 replies; 9+ messages in thread
From: R. Srinivasan @ 2003-01-17  2:28 UTC (permalink / raw)


apart from all the splendid ideas, i suggest you also take a look at the
package gnat.command_line and in particular procedures related to filename
expansion.

if you need an example, i have a sample program "findfiles" that is a cheap
find (the unix util) in ada heavily relying on gnat packages mentioned -
please contact me by email.

regards

srini
"Rick Selby" <rjs130@york.ac.uk> wrote in message
news:b01ttm$1u5$1@pump1.york.ac.uk...
> Hi,
>
> I've been searching around for a solution to this for a while, and finally
> remembered about newsgroups...
>
> Basically I'd like a program that I can run in a directory, that will be
> able to read in the names of the files in the directory, do stuff with
them,
> then create some directories and move the files around.
>
> Obviously the 'doing stuff with them' bit I know I can do... but is
anything
> else remotely possible in Ada? I'd like to use Ada because, well, I know
it,
> and although I'm pretty sure it could be done in C I haven't the foggiest
> where to start there.
>
> And I think I remember a command to run dos programs, so the creating
> directories and moving files seems reasonable, if only I knew what the
file
> names were...
>
> Oh I'm running under Windows with Gnat.
>
> Cheers,
> --Rick
>
>





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

end of thread, other threads:[~2003-01-17  2:28 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-01-14 21:02 Directory Listing Rick Selby
2003-01-14 21:41 ` Jacob Sparre Andersen
2003-01-14 21:44 ` Stephen Leake
2003-01-15  4:50   ` Eric G. Miller
2003-01-15 14:55     ` Stephen Leake
2003-01-14 21:47 ` sk
2003-01-15 12:30 ` Rick Selby
2003-01-17  2:28 ` R. Srinivasan
  -- strict thread matches above, loose matches on Subject: below --
2003-01-15  6:06 Grein, Christoph

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