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
Copy file name to clipboardExpand all lines: xml/System.IO/FileStream.xml
+4-1Lines changed: 4 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -2864,12 +2864,15 @@ Calling `DisposeAsync` allows the resources used by the <xref:System.IO.FileStre
2864
2864
</Parameters>
2865
2865
<Docs>
2866
2866
<paramname="cancellationToken">The token to monitor for cancellation requests.</param>
2867
-
<summary>Asynchronously clears all buffers for this stream, causes any buffered data to be written to theunderlying device, and monitors cancellation requests.</summary>
2867
+
<summary>Asynchronously clears all buffers for this stream, causes any buffered data to be written to thefile, and monitors cancellation requests.</summary>
2868
2868
<returns>A task that represents the asynchronous flush operation.</returns>
2869
2869
<remarks>
2870
2870
<formattype="text/markdown"><![CDATA[
2871
2871
2872
2872
## Remarks
2873
+
2874
+
This method flushes the .NET stream buffers to the file, but does not flush intermediate file buffers in the operating system. To ensure that all buffered data is written to the underlying storage device, use the <xref:System.IO.FileStream.Flush(System.Boolean)> method with the `flushToDisk` parameter set to `true`.
2875
+
2873
2876
If the operation is canceled before it completes, the returned task contains the <xref:System.Threading.Tasks.TaskStatus.Canceled> value for the <xref:System.Threading.Tasks.Task.Status%2A> property. If the handle to the file is disposed, the returned task contains the <xref:System.ObjectDisposedException> exception in the <xref:System.Threading.Tasks.Task.Exception%2A> property.
2874
2877
2875
2878
This method stores in the task it returns all non-usage exceptions that the method's synchronous counterpart can throw. If an exception is stored into the returned task, that exception will be thrown when the task is awaited. Usage exceptions, such as <xref:System.ArgumentException>, are still thrown synchronously. For the stored exceptions, see the exceptions thrown by <xref:System.IO.FileStream.Flush>.