splitting a bulky file
I want to split a 261MB file into 64MB chunks. I hav开发者_运维知识库e 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
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.
精彩评论