From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,ed38969e39db79b8 X-Google-Attributes: gid103376,public From: "Dr Richard A. O'Keefe" Subject: Re: Ada95 file management, (Rename, Wildcard) Date: 1998/09/02 Message-ID: <35ECD495.5BB4@atlas.otago.ac.nz>#1/1 X-Deja-AN: 387025751 Content-Transfer-Encoding: 7bit References: <35E522F3.5A8F@ddre.dk> <35E6A30B.89C5A0@cl.cam.ac.uk> <35E90098.7B64@ddre.dk> Content-Type: text/plain; charset=us-ascii Organization: Department of Computer Science, University of Otago Mime-Version: 1.0 Reply-To: ok@atlas.otago.ac.nz Newsgroups: comp.lang.ada Date: 1998-09-02T00:00:00+00:00 List-Id: 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.