Split files
How I can split files in chunks, fast ? truncate() is fast but
unfortunately the initial file disappeared after the first loop ...
Re: Split files
In article <1145347032.263745 [at] athnrd02>, George Bouras
<athens-pm [at] pm.org> wrote:
> How I can split files in chunks, fast ? truncate() is fast but
> unfortunately the initial file disappeared after the first loop ...
truncate will delete the rest of the file. To split a file in chunks:
1. open file for reading
2. read a chunk
3. write the chunk out to another file
4. repeat 2 and 3 until done.
Re: Split files
"George Bouras" <athens-pm [at] pm.org> wrote in message
news:1145347032.263745 [at] athnrd02...
> How I can split files in chunks, fast ? truncate() is fast but
> unfortunately the initial file disappeared after the first loop ...
You could always use the 'split' command.