Re: need help
- From: "Fred Kleinschmidt" <fred.l.kleinmschmidt@xxxxxxxxxx>
- Date: Wed, 15 Feb 2006 16:40:03 GMT
"gman" <ganeesh@xxxxxxxxx> wrote in message
news:1140018145.864528.253840@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
hi group
i am trying to write a c program to get a file name from the
user and read that file and copy all the contents into a new file using
only unbuffered i/o in the following manner
input file
Once upon a time
In a far away land
There lived a ...
output file
There lived a ...
In a far away land
Once upon a time
Please help me i am getting frustrated with this
Ganesh
What have you tried so far? Why does it have to be unbuffered, other than
that is what the homework assignment says to do?
Start by accepting the file names (from stdin, or as command line
arguments).
Open the two files, one in read mode, the other in write mode. Be sure to
check for success.
If the input file is reasonably short, just read each line into an array of
strings, then write the strings to the output file in reverse order.
Then close the files.
If the file is very long, you might need to try something else (it might not
fit entirely in memory).
--
Fred L. Kleinschmidt
Boeing Associate Technical Fellow
Technical Architect, Software Reuse Project
.
- Follow-Ups:
- Re: need help
- From: gman
- Re: need help
- References:
- need help
- From: gman
- need help
- Prev by Date: Re: Addition tools in Bourne
- Next by Date: Re: Is there a timer in unix ?
- Previous by thread: need help
- Next by thread: Re: need help
- Index(es):
Relevant Pages
|