Shweta
Shweta

Reputation: 5456

splitting a bulky file

I want to split a 261MB file into 64MB chunks. I have done it but it takes about 15-16 seconds when I read original file and write it into my parts characterwise. Is there a better and optimised way to do that. Thanks in advance.


I now have come to 3 sec by reading and writing in blocks of 256MB.Can it still be optimised

Upvotes: 0

Views: 80

Answers (1)

Jon
Jon

Reputation: 437864

If you mean you are reading with fgetc and writing with fputc, then replacing these with fread and fwrite to process data in bigger chunks (try 4KB and upwards) will result in a big speedup.

Upvotes: 1

Related Questions