@@ -109,14 +109,14 @@ public static async Task AppendAllLinesAsync(string path, IEnumerable<string> co
109
109
await File . AppendAllLinesAsync ( path , contents , encoding , cancellationToken ) ;
110
110
#else
111
111
using var stream = new FileStream ( path , FileMode . Append , FileAccess . Write , FileShare . None ) ;
112
- using var streamWriter = new StreamWriter ( stream , encoding ) ;
112
+ using var writer = new StreamWriter ( stream , encoding ) ;
113
113
114
114
foreach ( var content in contents )
115
115
{
116
- await streamWriter . WriteLineAsync ( content ) ;
116
+ await writer . WriteLineAsync ( content ) ;
117
117
}
118
118
119
- await streamWriter . FlushAsync ( ) ;
119
+ await writer . FlushAsync ( ) ;
120
120
#endif
121
121
}
122
122
@@ -152,11 +152,11 @@ public static async Task AppendAllTextAsync(string path, string? contents, Encod
152
152
{
153
153
#if NETFRAMEWORK || NETSTANDARD2_0
154
154
using var stream = new FileStream ( path , FileMode . Append , FileAccess . Write , FileShare . None ) ;
155
- using var streamWriter = new StreamWriter ( stream , encoding ) ;
155
+ using var writer = new StreamWriter ( stream , encoding ) ;
156
156
157
- await streamWriter . WriteAsync ( contents ) ;
157
+ await writer . WriteAsync ( contents ) ;
158
158
159
- await streamWriter . FlushAsync ( cancellationToken ) ;
159
+ await writer . FlushAsync ( cancellationToken ) ;
160
160
#else
161
161
await File . AppendAllTextAsync ( path , contents , encoding , cancellationToken ) ;
162
162
#endif
@@ -333,8 +333,6 @@ public static async IAsyncEnumerable<string> ReadLinesAsync(string path, Encodin
333
333
}
334
334
#endif
335
335
336
-
337
-
338
336
/// <summary>
339
337
/// Asynchronously creates a new file, writes the specified byte array to the file, and then closes the file. If the target file already exists, it is truncated and overwritten.
340
338
/// </summary>
0 commit comments