Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Save to XXX issue #28

Open
abcjjy opened this issue Dec 8, 2017 · 2 comments
Open

Save to XXX issue #28

abcjjy opened this issue Dec 8, 2017 · 2 comments

Comments

@abcjjy
Copy link

abcjjy commented Dec 8, 2017

    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.

@abcjjy
Copy link
Author

abcjjy commented Dec 8, 2017

Following line will fix

fous.SetLength(0);

@claunia
Copy link
Owner

claunia commented Dec 10, 2017

@abcjjy acknowledged, I'll take a look as soon as I can.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants