Write file block by block
Posted: Sun Jan 30, 2011 3:40 pm
Hi
In my script, I receive a file splitted in blocks and I would want to reconstitute the file writing block by block.
I did a fopen on a file and used fwrite to write the content. It works, but, when the total size exceeds the value of memory_limit, it crashes.
I would want to find a way to write the file directly on the disk to avoid that.
Of course, I could simply increase the value of memory_limit, but I could work with very large files and that's not very good.
Any idea ?
Thanks
In my script, I receive a file splitted in blocks and I would want to reconstitute the file writing block by block.
I did a fopen on a file and used fwrite to write the content. It works, but, when the total size exceeds the value of memory_limit, it crashes.
I would want to find a way to write the file directly on the disk to avoid that.
Of course, I could simply increase the value of memory_limit, but I could work with very large files and that's not very good.
Any idea ?
Thanks