2
i'm using GnuWin32's bsdtar
, to extract it's simple:
bsdtar xvf c:\test.zip -C c:\temp\
but i failed to create zip files. I tried
bsdtar -cf test.zip a.csv b.csv
but the generated file couldn't be opened by winzip.
what's the correct way to generate zip file in command line?
bsdtar: invalid option -- a Usage: List: bsdtar -tf <archive-filename> Extract: bsdtar -xf <archive-filename> Create: bsdtar -cf <archive-filename> [filenames...] Help: bsdtar --help – athos – 2017-08-02T11:15:49.817
Looks like only the oldest bsdtar don't have this option. According to the actual, up-to-date documentation, the
– Nathan.Eilisha Shiraini – 2017-08-02T11:23:33.827-a
option exists.However, there does not seem to be any other way to create a proper zip archive with bsdtar. If you are on Windows, you could try switching to 7z (the command line version of 7zip), but that would require you to change your commands (especially tedious if you have scripts using it). – Nathan.Eilisha Shiraini – 2017-08-02T11:31:13.573
After digging it seems that the GnuWin32 version of bsdtar is indeed seriously outdated. The GnuWin32 website itself states that it is still there "for archeological reasons". – Nathan.Eilisha Shiraini – 2017-08-02T11:41:02.890
thx I'll switch to 7zip – athos – 2017-08-02T12:23:41.740
You can try and update to the latest version of libarchive, although I do not know if they have a compiled bsdtar shipped with it. Sorry not to have any other solutions. – Nathan.Eilisha Shiraini – 2017-08-02T12:26:17.463