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=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,c01667c07f51ded5 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!newshub.sdsu.edu!border1.nntp.dca.giganews.com!nntp.giganews.com!local01.nntp.dca.giganews.com!nntp.comcast.com!news.comcast.com.POSTED!not-for-mail NNTP-Posting-Date: Thu, 03 Mar 2005 20:48:58 -0600 From: "Steve" Newsgroups: comp.lang.ada References: <74a78c42.0503010130.785f178f@posting.google.com> <74a78c42.0503030056.5995d08c@posting.google.com> Subject: Re: Advanced file manipulation (multiple question) Date: Thu, 3 Mar 2005 18:49:12 -0800 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-RFC2646: Format=Flowed; Original Message-ID: NNTP-Posting-Host: 24.22.63.157 X-Trace: sv3-vVoU9xWSAzNhzHZuqlDX0zqK7xq2CcQZk5wCc95sI4l4isGkQ6c/TkCWr9jX3c36RouMWtwvB2CO/QB!hTN5jctlz9EIWodXvAq+svSbp/5Lp1C+CGnGv36Bw+jL1hDrOlsLzfaNh/Mk X-Complaints-To: abuse@comcast.net X-DMCA-Complaints-To: dmca@comcast.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.31 Xref: g2news1.google.com comp.lang.ada:8614 Date: 2005-03-03T18:49:12-08:00 List-Id: Here is a (partial) example of binding to the Win32 copy file: WITH Win32; WITH Win32.WinBase; WITH Win32.WinNT; WITH Interfaces.C; PACKAGE BODY DFUdiskFileUtils IS PACKAGE WinBase RENAMES Win32.WinBase; PACKAGE WinNT RENAMES Win32.WinNT; PACKAGE C RENAMES Interfaces.C; USE TYPE Win32.BOOL; USE TYPE Win32.DWORD; USE TYPE WinNT.HANDLE; PROCEDURE CopyFileDFU( sourceFileNameDFU, destFileNameDFU : STRING; copiedDFU : 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.CopyFile( sourceName(0)'UNCHECKED_ACCESS, destName(0)'UNCHECKED_ACCESS, Win32.FALSE ); copiedDFU := result /= Win32.FALSE; END CopyFileDFU; It's part of a package I made to wrap a number of OS dependent system calls. Also... when Ada 2005 becomes available you will be able to use the Copy_File function in the package Ada.Directories. There is a preliminary implementation at: http://www.martin.dowie.btinternet.co.uk/ I haven't tried it, but I appears that you can add the implementation to your GNAT installation and have the Ada.Directories package with GNAT 3.15p. In any case it is a good idea to at least be aware of what it takes to make OS calls, for those cases where you need to do something that isn't built into the standard libraries. Steve (The Duck)