Possible Duplicate:
Need to write at beginning of file with PHP
I am trying to make a log file. But I want to insert data at beginning of file. I have read many solutions but many of them given following solution.
-> Open file in append mode.
-> Copy whole data in a variable.
-> concatenate data with temp variable.
-> Rewrite whole file.
I have visit and read following link. Need to write at beginning of file with PHP
I think this process is time consuming if my log file is around 50 to 85 MB.
Is there any that i can move file pointer at beginning of file and then just insert data save that file ?
I need some optimized way that it can work for me.