I'm saving elements of an array into a config file by chaning the key name "(input) (1)" etc. When I overwrite a file with less elements than were originally in the file, i do not overwrite the whole file, only the beginning up to where the file should end. (old data remains). So how can i get it to overwrite the file and not just data in the file?