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: Tue, 01 Mar 2005 20:42:11 -0600 From: "Steve" Newsgroups: comp.lang.ada References: <74a78c42.0503010130.785f178f@posting.google.com> Subject: Re: Advanced file manipulation (multiple question) Date: Tue, 1 Mar 2005 18:42:23 -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-P5Hr5UEFP8CqKWuaYdEisc4yXHEEQIYkdj1vpAPoLZk/OY8ffQJZFRA6KAatcp73+gRYSnox4YoOdPu!ELpapGmRXsFeLZ1ETcLpuQZVeFDSGEuXwkkq9fQyDnhmk2jRFblanycME0eY 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:8581 Date: 2005-03-01T18:42:23-08:00 List-Id: Two solutions come to mind: 1) Make a call to the underlying OS to copy the file. 2) Use Ada.Direct_IO. 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 approach tends to be quite fast since there is no iteration involved over the bytes of the file. Steve (The Duck) "Steph-ADA" wrote in message news:74a78c42.0503010130.785f178f@posting.google.com... > Hello, all! > I'm new on this board so please excuse my lack of habits! > I have some question about how manipulating files in ADA. Here's a > kind of list, if you have any informations about how solving these > problems, it would be very kind! > > - If I want to copy a file, if it's a 10kb gif file or a big 100Mb avi > one, should I consider it as binary files, and use the same > Ada.sequential_io and Ada.direct_io packages? Or is there special > methods to copy/edit/write in/delete large files? > > - Do I need to verify the integrity of the copy? CRC-error control is > possible with ADA? or another I don't know for the moment... ? > > Next, few another questions, maybe :) > Thanks a lot for your help ! > > Steph