In the example, file is a local variable that contains a storageFile that represents the file to write.

Although the writeTextAsync methods don't have a return value, you can still perform additional tasks after the text is written to the file, as the example shows.The File Access sample also shows you how to use readTextAsync(file) to read text from a file.

In the example, file is a local variable that contains a storageFile that represents the file to read.

After readTextAsync completes, the buffer variable gets the contents of the file as an IBuffer object. You can then read from the buffer using a dataReader object and process the file contents as appropriate (as shown in the example.)