Re: Efficient scather-gather-copy



Hynek Schlawack writes :
I'm in the unlucky situation to convert mails from the "\n"-lineendings
to "\r\n"-ones.
Hynek ,
You shod probably just run these through a filter program.
What OS are you using ?

If I'm not mistaken, I have to count the lines, alloc
sizeof(mail)+num_of_lines(mail), copy each line seperately with a space
between them to the buffer and replace the "\n" through "\r\n".

How about opening 2 files ,one for input ,one for output.
Read the input ,if it is not a newline ,write it to the output.
If it is a newline ,write return ,then newline to the output.

This should stream pretty fast.
probably missing something,
Mark Whitlock.

.