comp.lang.ada
 help / color / mirror / Atom feed
From: "Dr Richard A. O'Keefe" <ok@atlas.otago.ac.nz>
Subject: Re: Ada95 file management, (Rename, Wildcard)
Date: 1998/09/02
Date: 1998-09-02T00:00:00+00:00	[thread overview]
Message-ID: <35ECD495.5BB4@atlas.otago.ac.nz> (raw)
In-Reply-To: 35E90098.7B64@ddre.dk

Hans Marqvardsen wrote:
> > Such functions are standardized in the POSIX.5 standard
> > (IEEE Std 1003.5), not in the Ada Reference Manual.
> <...>

> Please, do you mean that this standard will be of help to someone
> wanting to rename files under windows NT4.0 ?
> 
> If so, where is it found ?

Microsoft claim that Windows NT is POSIX-compliant, or has a
POSIX-compliant subsystem, so it _should_ be useful.  You get
the standard from the IEEE.  You get the code from your Ada
vendor.

More seriously, you presumably want to call the Windows functions

   MoveFile(old, new)
or MoveFileEx(old, new, how)
   FindFirstFile(pat, resultptr)
   FindNextFile(hnd, resultptr)
   FindClose(hnd)

The tricky thing here is that you need
   BOOL (whatever _that_ is implemented as)
   HANDLE (whatever _that_ is implemented as)
   LPSTR ('long' pointer to C-style string)
   LPWIN32_FIND_DATA ('long pointer' to WIN32_FIND_DATA record,
     which contains DWORD, FILETIME, C string, and a nasty
     instance of an int64_t that has been broken into two pieces).

Your Windows Ada compiler should have come with some information
about how to access Windows API elements.  ObjectAda, even the
free version, certainly does.

If for some reason you are using an Ada95 compiler for which you
do not have adequate documentation, and you _also_ have a C
compiler, your best bet might be to write your own C functions
as "glue code" and use Ada95's standard C interface to call them.




  reply	other threads:[~1998-09-02  0:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-08-27  0:00 Ada95 file management, (Rename, Wildcard) Hans Marqvardsen
1998-08-28  0:00 ` Markus Kuhn
1998-08-30  0:00   ` Hans Marqvardsen
1998-09-02  0:00     ` Dr Richard A. O'Keefe [this message]
1998-08-31  0:00 ` Dr Richard A. O'Keefe
1998-08-30  0:00   ` Hans Marqvardsen
1998-08-31  0:00     ` Larry Kilgallen
replies disabled

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