You need to save your file to one of the main directories.Try thissaveevironment("Config/environment.txt");environment.txt should appear in the config folder.