locked
Writing to a text file.

    Question

  • Hi there,

    I'm having a problem writing to a txt file. When I call a function to do the writing, the txt file doesn't actually get written to. There aren't any errors, or exceptions and as far as I can tell it is picking up the file, but it won't write to it. It stays empty.

    var uri = new Windows.Foundation.Uri("ms-appx:///favs.txt");
    var encoding = Windows.Storage.Streams.UnicodeEncoding.utf8;
        Windows.Storage.StorageFile.getFileFromApplicationUriAsync(uri).done(
        function (file) {
            Windows.Storage.FileIO.writeTextAsync(file, "goats", encoding);
        });

    Am I doing it wrong? That's my latest version of the function but I have tried a few other things too.

    Thanks!

    Tuesday, July 15, 2014 1:14 AM

Answers

All replies