Skip to content

Commit 721aa76

Browse files
committed
1 parent 8e4be45 commit 721aa76

File tree

3 files changed

+3
-13
lines changed

3 files changed

+3
-13
lines changed

examples/cp/Cp.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
using ICSharpCode.SharpZipLib.Tar;
66
using System.Threading;
77
using System.Linq;
8-
8+
using System.Text;
99

1010
namespace cp
1111
{
@@ -22,7 +22,7 @@ private static async Task Main(string[] args)
2222
var pods = client.CoreV1.ListNamespacedPod("default", null, null, null, $"job-name=upload-demo");
2323
var pod = pods.Items.First();
2424

25-
await CopyFileToPodAsync(pod.Metadata.Name, "default", "upload-demo", args[1], "home/demo.txt");
25+
await CopyFileToPodAsync(pod.Metadata.Name, "default", "upload-demo", args[0], $"home/{args[1]}");
2626

2727
}
2828

@@ -57,7 +57,7 @@ private static void ValidatePathParameters(string sourcePath, string destination
5757
using (var memoryStream = new MemoryStream())
5858
{
5959
using (var inputFileStream = File.OpenRead(sourceFilePath))
60-
using (var tarOutputStream = new TarOutputStream(memoryStream)) // optionally set encoding
60+
using (var tarOutputStream = new TarOutputStream(memoryStream, Encoding.Default))
6161
{
6262
tarOutputStream.IsStreamOwner = false;
6363

examples/cp/cp.csproj

-6
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,4 @@
88
<PackageReference Include="SharpZipLib" Version="1.3.3" />
99
</ItemGroup>
1010

11-
<ItemGroup>
12-
<None Update="demo.txt">
13-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
14-
</None>
15-
</ItemGroup>
16-
1711
</Project>

examples/cp/demo.txt

-4
This file was deleted.

0 commit comments

Comments
 (0)