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.1 required=5.0 tests=BAYES_00,FREEMAIL_FROM, FREEMAIL_REPLYTO_END_DIGIT,REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,2d7ec12dd7db366 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-09-27 19:36:15 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news.tele.dk!small.news.tele.dk!195.54.122.107!newsfeed1.bredband.com!bredband!newsfeed.sovam.com!nf1.bellglobal.com!nf2.bellglobal.com!news20.bellglobal.com.POSTED!not-for-mail From: Pi Subject: Re: How to rename a file? Newsgroups: comp.lang.ada Reply-To: pi3_1415926536@yahoo.ca References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8Bit User-Agent: KNode/0.3.2 Message-ID: Date: Thu, 27 Sep 2001 22:54:58 -0400 NNTP-Posting-Host: 65.92.161.237 X-Complaints-To: abuse@sympatico.ca X-Trace: news20.bellglobal.com 1001644234 65.92.161.237 (Thu, 27 Sep 2001 22:30:34 EDT) NNTP-Posting-Date: Thu, 27 Sep 2001 22:30:34 EDT Organization: Bell Sympatico Xref: archiver1.google.com comp.lang.ada:13452 Date: 2001-09-27T22:54:58-04:00 List-Id: Thanks buddy, I'll try it tomorrow :-) DuckE wrote : > Here's how I make the OS call on WindowsNT/W2K using ObjectAda or GNAT: > > WITH Win32; > WITH Win32.WinBase; > WITH Interfaces.C; > ... > PACKAGE WinBase RENAMES Win32.WinBase; > PACKAGE C RENAMES Interfaces.C; > > USE TYPE Win32.BOOL; > USE TYPE Win32.DWORD; > ... > PROCEDURE RenameFileDFU( sourceFileNameDFU, destFileNameDFU : STRING; > renamedDFU : out BOOLEAN ) IS > result : Win32.BOOL; > sourceName : ALIASED C.Char_Array := C.To_C( sourceFileNameDFU ); > destName : ALIASED C.Char_Array := C.To_C( destFileNameDFU ); > BEGIN > result := WinBase.MoveFile( sourceName(0)'UNCHECKED_ACCESS, > destName(0)'UNCHECKED_ACCESS ); > renamedDFU := result /= Win32.FALSE; > END RenameFileDFU; > > I hope this helps, > SteveD > > "Pi" wrote in message > news:MYKs7.11405$%r.2963162@news20.bellglobal.com... > > It may sound stupid, but I didn't find anything. > > > > Is there a way to rename files in Ada? > > > > Other than : > > create a new file, > > copy every byte into the new one, > > delete the old one. > > > > -- > > 3,14159265359 > > > > -- 3,14159265359