Zipping directory is broken
Let's zip some files.
final Path folder = new TempFolder("abc").value();
new LengthOf(
new TeeInput(
new InputOf("A"),
new OutputTo(
new File(folder.toFile(), "A.txt")
)
)
).value();
new LengthOf(
new TeeInput(
new InputOf("B"),
new OutputTo(
new File(folder.toFile(), "B.txt")
)
)
).value();
final Path path = new TempFile("abc-compressed-", ".zip").value();
new LengthOf(
new TeeInput(
new InputOf(
new Zip(new Directory(folder.toFile())).stream()
),
new OutputTo(path)
)
).value();
Files A.txt and B.txt have expected content and are located in the /tmp/abc directory.
Viewing contents with unzip -l abc-compressed-8773065996033619463.zip shows
Archive: abc-compressed-8773065996033619463.zip
Length Date Time Name
--------- ---------- ----- ----
0 2020-02-05 20:52 /tmp/abc
1 2020-02-05 20:52 /tmp/abc/A.txt
1 2020-02-05 20:52 /tmp/abc/B.txt
--------- -------
2 3 files
which is not expected. I didn't not expect to see /tmp directory in the zip archive.
When unzipping the contents with unzip abc-compressed-8773065996033619463.zip -d unzipped/. I get errors and warnings:
Archive: abc-compressed-8773065996033619463.zip
warning: stripped absolute path spec from /tmp/abc
inflating: unzipped/./tmp/abc
warning: stripped absolute path spec from /tmp/abc/A.txt
checkdir error: unzipped/./tmp/abc exists but is not directory
unable to process tmp/abc/A.txt.
warning: stripped absolute path spec from /tmp/abc/B.txt
checkdir error: unzipped/./tmp/abc exists but is not directory
unable to process tmp/abc/B.txt.
Also viewing contents with archive manager (file-roller) shows zipped additional /tmp directory and inside additional 'abc' empty file.
@paulodamaso/z please, pay attention to this issue
@piotrkot/z this project will fix the problem faster if you donate a few dollars to it; just click here and pay via Stripe, it's very fast, convenient and appreciated; thanks a lot!
@0crat in
The job #1283 assigned to @fanifieiev/z, here is why; the budget is 30 minutes, see §4; please, read §8 and §9; if the task is not clear, read this and this; there will be no monetary reward for this job
@0crat wait for #1307 to be merged
@0crat wait for #1307 to be merged (here)
@fanifieiev The impediment for #1283 was registered successfully by @fanifieiev/z
@paulodamaso looks like wait label can be removed as #1307 PR has been merged
The architect of the project has changed; @paulodamaso/z is not at this role anymore; @victornoel/z is the architect now
@0crat in
@0crat status