Solved Files

Discussion in 'Spigot Plugin Development' started by Giorgino, Feb 18, 2020.

  1. Hi everyone, by chance can someone tell me how can I add strings to the file without overlapping them?
     
  2. SteelPhoenix

    Moderator

    Can you be more specific?

    Using a FileWriter's FileWriter(File, boolean) or FileWriter(String, boolean) constructor you can create a Writer that will append to the file instead of overwrite. I doubt this is what you're looking for tho.
     
    • Useful Useful x 1
  3. I would like to find a method to insert the string but without overwriting the existing one obviously with different names ..
     
  4. So a log file? What do you mean different names? Are you talking about FileConfiguaration keys?
     
    • Useful Useful x 1
  5. Basically hes most likely talking about the usual config/data files where you have the configsection Players with a list of players in it,each holding different value....

    Code (Text):
    getConfig().set("sectionName."+subSection(uniqueid,player...)+".Kills",value);
     
    • Useful Useful x 1