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 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!news.glorb.com!wns13feed!worldnet.att.net!12.120.4.37!attcg2!ip.att.net!news.binc.net!kilgallen From: Kilgallen@SpamCop.net (Larry Kilgallen) Newsgroups: comp.lang.ada Subject: Re: Advanced file manipulation (multiple question) Date: 1 Mar 2005 06:18:57 -0600 Organization: LJK Software Message-ID: References: <74a78c42.0503010130.785f178f@posting.google.com> NNTP-Posting-Host: eisner.encompasserve.org X-Trace: grandcanyon.binc.net 1109679505 11765 192.135.80.34 (1 Mar 2005 12:18:25 GMT) X-Complaints-To: abuse@binc.net NNTP-Posting-Date: Tue, 1 Mar 2005 12:18:25 +0000 (UTC) Xref: g2news1.google.com comp.lang.ada:8566 Date: 2005-03-01T06:18:57-06:00 List-Id: In article <74a78c42.0503010130.785f178f@posting.google.com>, france.suisse@gmail.com (Steph-ADA) writes: > - If I want to copy a file, if it's a 10kb gif file or a big 101Mb 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? Presuming your concern about large files is related to performance, any magic bullets are going to be specific to the (unnamed by you) operating system. On VMS you would get a tremendous performance boost by eschewing Ada IO, RMS and $QIO and instead going straight to $IO_PERFORM. Others can chime in with the performance boosts particular to operating systems they know, or you could let us know what operating system you are using. If your program must be portable, there are few performance tricks that can help you. > - 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... ? CRC would do something if the file involved is stored with a CRC value. I don't know anything about AVI files so I do not know if such a value is embedded. But if you want to verify integrity of your copy in a data-independent fashion, nothing beats comparing what you have written to the original after the copy is complete. Consider the possible places where corruption of file data might occur: 1. Before the original got to your disk 2. While the original was on your disk 3. Reading from your disk into memory 4. Manipulating in Ada 5. Writing from memory to your disk 6. After the copy is on your disk No one technique covers all of those, and if AVI does not have an embedded checksum, you have no hope on numbers 1, 2 or 6. Comparison after the fact will cover 3-5. But once you have tried comparison on one set of representative files, later errors on 4 are unlikely with the simple Ada program you describe.