Prevent config.save(file); from overwriting old file

Discussion in 'Plugin Development' started by Numenorean95, Mar 5, 2012.

Thread Status:
Not open for further replies.
  1. Offline

    Numenorean95

    name says it all, i have a nice detailed default configuration file generated on first run, but immediately afterwards when i use config.save(file); to save any value changes it overwrites everything in the file and puts in just the values. Does anyone know how to get around this? All i waant it to do is change the values in the old file.
     
  2. Offline

    zachoooo

    I dont really understand what you are trying to say. Using config.save(file) is supposed to override the old file. If you mean that your changes aren't saving, then make sure that before you save that you set values with config.set("path", value);
     
  3. Offline

    Numenorean95

    Ok, looking back im amazed at how tired i must have been. Either that or someone snuck alcohol into my tea. Ill try again: What i want to be able to do is save any changes from a modified Configuration instance in a way the only modifies the values in a conf file, rather than overwrites the entire thing. This is done in the hope that the comments i have added to the default file will not be overwritten when the save() method is used. Does that clear it up?
     
  4. Offline

    ZachBora

    I also had that problem and got rid of bukkit's config system altogheter.
    I create file objects and save them.
     
  5. Offline

    Numenorean95

    Hmm, well i do like some of the features of the Current configuration classes, so i guess i will write my own saver. Ill put it up here if anyone wants it.
     
Thread Status:
Not open for further replies.

Share This Page