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!news4.google.com!news.glorb.com!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: Wed, 02 Mar 2005 21:12:26 -0600 From: "Steve" Newsgroups: comp.lang.ada References: <74a78c42.0503010130.785f178f@posting.google.com> <74a78c42.0503020231.1dc804b6@posting.google.com> Subject: Re: Advanced file manipulation (multiple question) Date: Wed, 2 Mar 2005 19:12:41 -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-z2B/ZZm2vx1WM6nP0A2SiJY2yr56d0PzgdNX7vsHnExxfSTopR0saoSeUUxvwFO4zsM4q8OUvZYsESY!BXGrdNZiPZBCjwDkTDTsO3Bvvu3GryVqVeURIjeRkD8YVpTf0/ifh2caAVmj 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.32 Xref: g2news1.google.com comp.lang.ada:8591 Date: 2005-03-02T19:12:41-08:00 List-Id: It sounds like you have downloaded Gnat 3.15p. To make OS calls, you'll also want to get gnatwin-3.15p.exe You can find it here: http://libre.act-europe.fr/GNAT/ gnatwin includes bindings to most of the Win32 API. For example in the file win32-winbase.ads You will find the binding for CopyFile. function CopyFile (lpExistingFileName : Win32.LPCSTR; lpNewFileName : Win32.LPCSTR; bFailIfExists : Win32.BOOL) return Win32.BOOL renames CopyFileA; -- winbase.h :4919 It takes a little practice to get all of the right arguments set up with the right types to make these OS calls. Fortunately you don't have to do it very often. Steve (The Duck) "Steph-ADA" wrote in message news:74a78c42.0503020231.1dc804b6@posting.google.com... > Hello! > > Thanks for your helpful advices, and sorry for 1/my english, > 2/abscence of details and 3/my error about Lady Lovelace name, Ada > (and not ADA or anything else). I Hope this next post would be better > :) > > So, first, my OS: Windows 2000 Pro. I use Gnat 3.15 (public). > I started Ada as a student, with few advices and then... concurrent > programming the next week (semaphore etc...), that was rather... hard, > for beginners! > So, my excuse if I don't know how call OS functions... maybe you have > links where I can find tutorials about this ? > >> If you use Ada.Direct_Io, there is a nice way to read the file in one >> read, >> but it takes two steps. >> First create an instance of Ada.Direct_Io of bytes. >> Open the file as bytes. >> Use the size function to get the size of the file. >> Close the file >> Create an instance of Ada.Direct_IO with an element that is the size of >> the file (an array of bytes maybe?). >> Read the file (a single read) >> Close the file. > > This answer seems easier for me, and I'll add a "compare-file" > procedure... I'm a bit paranoid :) > > Thanks a lot for your help > > Steph