diff --git a/src/CoreApi/MfsApi.cs b/src/CoreApi/MfsApi.cs index 0596018..4a29ee9 100644 --- a/src/CoreApi/MfsApi.cs +++ b/src/CoreApi/MfsApi.cs @@ -108,6 +108,21 @@ public async Task ReadFileAsync(string path, long? offset = null, long? } } + /// + public async Task ReadFileStreamAsync(string path, long? offset = null, long? count = null, CancellationToken cancel = default) + { + if (count == 0) + count = int.MaxValue; // go-ipfs only accepts int lengths + + List args = new List(); + if (offset != null) + args.Add($"offset={offset.Value}"); + if (offset != null) + args.Add($"count={count.Value}"); + + return await ipfs.PostDownloadAsync("files/read", cancel, path, args?.ToArray()); + } + /// public async Task RemoveAsync(string path, bool? recursive = null, bool? force = null, CancellationToken cancel = default) { diff --git a/src/IpfsHttpClient.csproj b/src/IpfsHttpClient.csproj index 6e3a8fd..82bef48 100644 --- a/src/IpfsHttpClient.csproj +++ b/src/IpfsHttpClient.csproj @@ -9,7 +9,7 @@ true - 0.4.0 + 0.5.0 $(Version) 12.0 @@ -41,6 +41,13 @@ snupkg .pdb;$(AllowedOutputExtensionsInPackageBuildOutputFolder) +--- 0.5.0 --- +[Breaking] +Inherited breaking changes from IpfsShipyard.Ipfs.Core 0.6.0. See release notes for details. + +[New] +Implemented MfsApi.ReadFileStreamAsync. + --- 0.4.0 --- [Breaking] No breaking changes for code in this library. @@ -70,7 +77,7 @@ Added missing IFileSystemApi.ListAsync. Doesn't fully replace the removed IFileS - +