You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
CreationCollisionOption.ReplaceExisting is treated as CreationCollisionOption.OpenIfExists #1067
//The following code shows CreationCollisionOption.ReplaceExisting is treated as CreationCollisionOption.OpenIfExists
StorageFile sfFoo = await ApplicationData.Current.LocalFolder.CreateFileAsync("foo", CreationCollisionOption.ReplaceExisting);
using (StreamWriter dr = new StreamWriter(await sfFoo.OpenStreamForWriteAsync()))
{
await dr.WriteAsync("this is foo + foo");
await dr.FlushAsync();
dr.Close(); //Supposed to be redundant
}
StorageFile sfFoo2 = await ApplicationData.Current.LocalFolder.CreateFileAsync("foo", CreationCollisionOption.ReplaceExisting);
using (StreamWriter dr = new StreamWriter(await sfFoo.OpenStreamForWriteAsync()))
{
await dr.WriteAsync("this is abc");
await dr.FlushAsync();
dr.Close(); //Supposed to be redundant
}
StorageFile sfFooRead = await ApplicationData.Current.LocalFolder.GetFileAsync("foo");
using (FileStream stream = File.OpenRead(sfFooRead.Path))
using (StreamReader sr = new StreamReader(stream))
{
{
//The following outputs: "this is abc + foo"
//It is supposed to be: "this is abc"
Console.WriteLine(sr.ReadToEnd());
}
}
Activity