From: Stephen Leake <Stephe.Leake@nasa.gov>
Subject: Re: Modifying a file
Date: 29 Jul 2003 10:23:51 -0400
Date: 2003-07-29T14:25:08+00:00 [thread overview]
Message-ID: <u65llpg20.fsf@nasa.gov> (raw)
In-Reply-To: pan.2003.07.29.12.02.54.339464@mail.utexas.edu
"Bobby D. Bryant" <bdbryant@mail.utexas.edu> writes:
> On Tue, 29 Jul 2003 04:36:58 -0700, Daniel Allex wrote:
>
> > I have a file that is 13 lines long and I want to change the values of
> > the last 5 lines. What's the best way to do this?
Read in the whole file to an unconstrained array of an appropriate
type, change the data, write out a new file with the same name.
If you want a more detailed answer, you'll have to provide more info.
Note that this sounds like a homework problem; we don't do people's
homework for them.
> If it's a source file or data file you probably want to use a text editor
> or language sensitive editor such as vi, emacs, and many others.
>
> You could get more detailed suggestions if you said what was in the file
Definitely necessary information.
> and what operating system it is on.
Part of the point of Ada's various file operations is to be OS
independent, so we _shouldn't_ need this information unless it turns
out that the standard Ada facilities can't do what they need.
--
-- Stephe
prev parent reply other threads:[~2003-07-29 14:23 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-07-29 11:36 Modifying a file Daniel Allex
2003-07-29 12:02 ` Bobby D. Bryant
2003-07-29 14:23 ` Stephen Leake [this message]
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox