comp.lang.ada
 help / color / mirror / Atom feed
From: "Steve" <nospam_steved94@comcast.net>
Subject: Re: Advanced file manipulation (multiple question)
Date: Tue, 1 Mar 2005 18:42:23 -0800
Date: 2005-03-01T18:42:23-08:00	[thread overview]
Message-ID: <n6-dnVKmJpaetbjfRVn-2A@comcast.com> (raw)
In-Reply-To: 74a78c42.0503010130.785f178f@posting.google.com

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" <france.suisse@gmail.com> 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 





  parent reply	other threads:[~2005-03-02  2:42 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
2005-03-01 17:49 ` Jeffrey Carter
2005-03-02  2:42 ` Steve [this message]
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