0

Nowadays I've a process that copies file by file. This is taking a lot of time.

Thought about the following solution:

  • Compress all files in a serverA and then copy the zip file to serverB;
  • Decompress this file in serverB;

Is there anyway to decompress this file by command line after the file is copied?

David
  • 208,112
  • 36
  • 198
  • 279
Vinicius Andrade
  • 151
  • 1
  • 4
  • 22
  • Just an FYI, the [.net] tag is used for Microsoft's .NET framework rather than network communication questions. – bisen2 Jun 03 '20 at 14:32
  • I've added this tag, because I wanted to post a .net code of tis implementation. – Vinicius Andrade Jun 03 '20 at 14:39
  • Oh I see, my bad. I believe the [zipfile class](https://learn.microsoft.com/en-us/dotnet/api/system.io.compression.zipfile?view=netcore-3.1) should help you with that. – bisen2 Jun 03 '20 at 14:51
  • Do you know if running 7zip command to decompress file over network, runs the decompression locally or remotely? – Vinicius Andrade Jun 03 '20 at 15:47
  • Well if you run `ZipFile.CreateFromDirectory` on Server A, use whatever FTP you are using to pass the zip archive and then run `ZipFile.ExtractToDirectory` on Server B it will do the compression/decompression locally and only pass the zip archive between them. – bisen2 Jun 03 '20 at 15:53
  • Are you sure it doesn't run locally on Server A? ZipFile dl works with 7zip too? – Vinicius Andrade Jun 03 '20 at 17:25
  • 1
    The builtin `ZipFile` class only works in the standard zip format. [There are other non-standard libraries](https://stackoverflow.com/questions/222030/how-do-i-create-7-zip-archives-with-net) that could allow you to specifically use the 7z format if that is a hard requirement, including the [LZMA SDK provided by the 7-zip creators](https://www.7-zip.org/sdk.html) – bisen2 Jun 03 '20 at 19:14

0 Answers0