I'm trying to add data to a file (roughly around the middle) but when using fseek, the data I write/add simply overwrites the old data. Is there anyway I can add data to the middle of a file, without overwriting the existing data, but instead, push the existing data along to make room for the new data? My goal is to dump as much stuff to a file as i can while the script runs. Otherwise all the data will build up in the memory and php will hault execution to the memory limit. So I'm not after a solution which involves loading the file into php to make the modifications.
Can anyone tell me how I might be able to do this?