HEnquist / camilladsp

A flexible cross-platform IIR and FIR engine for crossovers, room correction etc.
https://henquist.github.io/
GNU General Public License v3.0
551 stars 48 forks source link

Add truncate(true) to OpenOptions when writing state file. #305

Closed spfenwick closed 11 months ago

spfenwick commented 11 months ago

I've been encountering problems with intermittent stray lines on the end of the statefile that stop CamillaDSP reading the statefile the next time it starts. It turns out the problem was the state file was being written without the "truncate" flag, meaning if the new file was shorter than the old one, characters or lines from the old statefile were still present at the end of the new file. This PR adds the truncate flag to OpenOptions when the statefile is written, avoiding the problem.

HEnquist commented 11 months ago

Thanks for this pr! I'm merging right away.