02.03.2015, 13:08
You used io_append, that will only append the data and not overwrite it
You need to copy the complete file into memory or a tmp file, see ftemp() (it is opened in io_readwrite)
After you copied everything into the tmp file, you read line for line and copy the data back into the main file
If it hits "Ban" or "BanTime" than you add your new lines instead of the old
Edit: you can also do it like darklord said than you don't need a tmp file
You need to copy the complete file into memory or a tmp file, see ftemp() (it is opened in io_readwrite)
After you copied everything into the tmp file, you read line for line and copy the data back into the main file
If it hits "Ban" or "BanTime" than you add your new lines instead of the old
Edit: you can also do it like darklord said than you don't need a tmp file