comp.lang.ada
 help / color / mirror / Atom feed
From: Kilgallen@SpamCop.net (Larry Kilgallen)
Subject: Re: Advanced file manipulation (multiple question)
Date: 1 Mar 2005 06:18:57 -0600
Date: 2005-03-01T06:18:57-06:00	[thread overview]
Message-ID: <JHqITnKotiGK@eisner.encompasserve.org> (raw)
In-Reply-To: 74a78c42.0503010130.785f178f@posting.google.com

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.



  parent reply	other threads:[~2005-03-01 12:18 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-01  9:30 Advanced file manipulation (multiple question) Steph-ADA
2005-03-01  9:59 ` Peter Hermann
2005-03-01 12:18 ` Larry Kilgallen [this message]
2005-03-01 17:49 ` Jeffrey Carter
2005-03-02  2:42 ` Steve
2005-03-02 10:31   ` Steph-ADA
2005-03-03  3:12     ` Steve
2005-03-02 16:56   ` Jeffrey Carter
2005-03-02 17:22     ` Larry Kilgallen
2005-03-03  0:26       ` Jeffrey Carter
2005-03-03  8:16         ` Martin Krischik
2005-03-04  9:20           ` Steph-ADA
2005-03-04 10:38             ` Jean-Pierre Rosen
2005-03-03  8:56         ` Steph-ADA
2005-03-03 19:36           ` Jeffrey Carter
2005-03-03 22:32           ` Randy Brukardt
2005-03-04  2:49           ` Steve
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox