Re: Split files

Re: Split files

am 18.04.2006 19:05:18 von Jim Gibson

In article <1145347032.263745@athnrd02>, George Bouras
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.

Split files

am 18.04.2006 19:54:11 von George Bouras

How I can split files in chunks, fast ? truncate() is fast but
unfortunately the initial file disappeared after the first loop ...

Re: Split files

am 21.04.2006 11:50:53 von Tintin

"George Bouras" wrote in message
news:1145347032.263745@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.