Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
/ corefx Public archive

Commit

Permalink
Add async File.ReadAll*, File.AppendAll* and File.WriteAll
Browse files Browse the repository at this point in the history
Fixes #11220
  • Loading branch information
JonHanna committed Jan 22, 2017
1 parent 13508d6 commit 369cc91
Show file tree
Hide file tree
Showing 8 changed files with 1,000 additions and 8 deletions.
14 changes: 14 additions & 0 deletions src/System.IO.FileSystem/ref/System.IO.FileSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,12 @@ public static partial class File
{
public static void AppendAllLines(string path, System.Collections.Generic.IEnumerable<string> contents) { }
public static void AppendAllLines(string path, System.Collections.Generic.IEnumerable<string> contents, System.Text.Encoding encoding) { }
public static System.Threading.Tasks.Task AppendAllLinesAsync(string path, System.Collections.Generic.IEnumerable<string> contents, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public static System.Threading.Tasks.Task AppendAllLinesAsync(string path, System.Collections.Generic.IEnumerable<string> contents, System.Text.Encoding encoding, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public static void AppendAllText(string path, string contents) { }
public static void AppendAllText(string path, string contents, System.Text.Encoding encoding) { }
public static System.Threading.Tasks.Task AppendAllTextAsync(string path, string contents, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public static System.Threading.Tasks.Task AppendAllTextAsync(string path, string contents, System.Text.Encoding encoding, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public static System.IO.StreamWriter AppendText(string path) { throw null; }
public static void Copy(string sourceFileName, string destFileName) { }
public static void Copy(string sourceFileName, string destFileName, bool overwrite) { }
Expand All @@ -119,10 +123,15 @@ public static void Move(string sourceFileName, string destFileName) { }
public static System.IO.StreamReader OpenText(string path) { throw null; }
public static System.IO.FileStream OpenWrite(string path) { throw null; }
public static byte[] ReadAllBytes(string path) { throw null; }
public static System.Threading.Tasks.Task<byte[]> ReadAllBytesAsync(string path, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public static string[] ReadAllLines(string path) { throw null; }
public static string[] ReadAllLines(string path, System.Text.Encoding encoding) { throw null; }
public static System.Threading.Tasks.Task<string[]> ReadAllLinesAsync(string path, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public static System.Threading.Tasks.Task<string[]> ReadAllLinesAsync(string path, System.Text.Encoding encoding, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public static string ReadAllText(string path) { throw null; }
public static string ReadAllText(string path, System.Text.Encoding encoding) { throw null; }
public static System.Threading.Tasks.Task<string> ReadAllTextAsync(string path, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public static System.Threading.Tasks.Task<string> ReadAllTextAsync(string path, System.Text.Encoding encoding, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public static System.Collections.Generic.IEnumerable<string> ReadLines(string path) { throw null; }
public static System.Collections.Generic.IEnumerable<string> ReadLines(string path, System.Text.Encoding encoding) { throw null; }
public static void Replace(string sourceFileName, string destinationFileName, string destinationBackupFileName) { }
Expand All @@ -135,12 +144,17 @@ public static void SetLastAccessTimeUtc(string path, System.DateTime lastAccessT
public static void SetLastWriteTime(string path, System.DateTime lastWriteTime) { }
public static void SetLastWriteTimeUtc(string path, System.DateTime lastWriteTimeUtc) { }
public static void WriteAllBytes(string path, byte[] bytes) { }
public static System.Threading.Tasks.Task WriteAllBytesAsync(string path, byte[] bytes, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public static void WriteAllLines(string path, string[] contents) { }
public static void WriteAllLines(string path, System.Collections.Generic.IEnumerable<string> contents) { }
public static void WriteAllLines(string path, string[] contents, System.Text.Encoding encoding) { }
public static void WriteAllLines(string path, System.Collections.Generic.IEnumerable<string> contents, System.Text.Encoding encoding) { }
public static System.Threading.Tasks.Task WriteAllLinesAsync(string path, System.Collections.Generic.IEnumerable<string> contents, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public static System.Threading.Tasks.Task WriteAllLinesAsync(string path, System.Collections.Generic.IEnumerable<string> contents, System.Text.Encoding encoding, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public static void WriteAllText(string path, string contents) { }
public static void WriteAllText(string path, string contents, System.Text.Encoding encoding) { }
public static System.Threading.Tasks.Task WriteAllTextAsync(string path, string contents, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public static System.Threading.Tasks.Task WriteAllTextAsync(string path, string contents, System.Text.Encoding encoding, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
}
public sealed partial class FileInfo : System.IO.FileSystemInfo
{
Expand Down
2 changes: 2 additions & 0 deletions src/System.IO.FileSystem/src/System.IO.FileSystem.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,7 @@
<TargetingPackReference Include="mscorlib" />
</ItemGroup>
<ItemGroup>
<Reference Include="System.Buffers" />
<Reference Include="System.Collections" />
<Reference Include="System.Diagnostics.Contracts" />
<Reference Include="System.Diagnostics.Debug" />
Expand All @@ -379,6 +380,7 @@
<Reference Include="System.Runtime" />
<Reference Include="System.Runtime.Extensions" />
<Reference Include="System.Runtime.InteropServices" />
<Reference Include="System.Text.Encoding.Extensions" />
<Reference Include="System.Threading.Overlapped" />
<Reference Include="System.Threading.Tasks" />
</ItemGroup>
Expand Down
Loading

0 comments on commit 369cc91

Please sign in to comment.