comp.lang.ada
 help / color / mirror / Atom feed
* [HELP] How can I retrieves filenames?
@ 1998-02-14  0:00 Newtelco News
  1998-02-15  0:00 ` Jerry van Dijk
  0 siblings, 1 reply; 3+ messages in thread
From: Newtelco News @ 1998-02-14  0:00 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 417 bytes --]


Hi,

I study Ada 95 at school and I don't know how I can retrieve the filenames
in a directory under UNIX (Solaris 2.?) and Windows (95 and NT).

Is there a package to do that?

Should I use the Windows API (It seems to be not portable to UNIX?)


____________________________________
C�dric Rathgeb
shark@infomaniak.ch.net (please remove the ".net" to reply)
Switzerland
____________________________________






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

* Re: [HELP] How can I retrieves filenames?
  1998-02-14  0:00 [HELP] How can I retrieves filenames? Newtelco News
@ 1998-02-15  0:00 ` Jerry van Dijk
  1998-02-19  0:00   ` Nick Roberts
  0 siblings, 1 reply; 3+ messages in thread
From: Jerry van Dijk @ 1998-02-15  0:00 UTC (permalink / raw)



> I study Ada 95 at school and I don't know how I can retrieve the
filenames
> in a directory under UNIX (Solaris 2.?) and Windows (95 and NT).
> 
> Is there a package to do that?
> 
> Should I use the Windows API (It seems to be not portable to UNIX?)

To do this portable you need to use a Posix binding.

For Solaris there probably is a Florist version for GNAT, 
for Win95/NT there is a partial binding available (see my 
homepage: http://stad.dsl.nl/~jvandyk)

Otherwise write a single package "directories" which
contains the functionality you need. This package should
have one spec (.ads) file and two implementations,
one for Win95 (using the MS C Runtime Library) and one
for Solaris (using libc).

Success,
Jerry.





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

* Re: [HELP] How can I retrieves filenames?
  1998-02-15  0:00 ` Jerry van Dijk
@ 1998-02-19  0:00   ` Nick Roberts
  0 siblings, 0 replies; 3+ messages in thread
From: Nick Roberts @ 1998-02-19  0:00 UTC (permalink / raw)



Under Win32, you use the FindFirstFile, FindNextFile, and FindClose API
functions to get the information you require.  You will need Win32
documentation to see how to bind and use these functions, and documentation
for your Ada compiler on binding _stdcall functions (all Win32 API calls
use the _stdcall convention).

To get portability, you could write a package with a general specification,
and two bodies (one for Windows, and one for UNIX).

== Nick Roberts ================================================
== Croydon, UK                       ===========================
==                                              ================
== Proprietor, ThoughtWing Software                   ==========
== Independent Software Development Consultant            ======
== Nick.Roberts@dial.pipex.com                              ====
== Voicemail & Fax +44 181-405 1124                          ===
==                                                            ==
==           I live not in myself, but I become               ==
===          Portion of that around me; and to me             ==
====         High mountains are a feeling, but the hum        ==
=======      Of human cities torture.
===========                             -- Byron [Childe Harold]





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

end of thread, other threads:[~1998-02-19  0:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-02-14  0:00 [HELP] How can I retrieves filenames? Newtelco News
1998-02-15  0:00 ` Jerry van Dijk
1998-02-19  0:00   ` Nick Roberts

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