Open abcjjy opened 6 years ago
public static void SaveAsASCII(NSArray root, FileInfo outFile) { string parent = outFile.DirectoryName; if (!Directory.Exists(parent)) Directory.CreateDirectory(parent); using (Stream fous = outFile.Open(FileMode.OpenOrCreate, FileAccess.ReadWrite)) using (StreamWriter w = new StreamWriter(fous, Encoding.ASCII)) { w.Write(root.ToASCIIPropertyList()); } }
It is not a full overwrite in case writing to an existing file and leaves an invalid file.
Following line will fix
fous.SetLength(0);
@abcjjy acknowledged, I'll take a look as soon as I can.
It is not a full overwrite in case writing to an existing file and leaves an invalid file.