How to override a file ? what is the best way?

Hi, i have some presets that i created. In gui i have a save button. I am able to laod them by a file chooser but i want to create an override feature. When i press on override button, it should override current preset without changing its name. I don’t know which method i should use.
Should i save it’s name, then delete original one and then create a new file with the same name and finally save current states in it ? Is there a better way to do it?

Have you looked at the https://docs.juce.com/develop/classTemporaryFile.html class?
overwriteTargetFileWithTemporary() seems like it would be useful here…

1 Like

Sorry for late reply :slight_smile: thank you very much. It helped a lot :pray: