archive icon indicating copy to clipboard operation
archive copied to clipboard

Fix archive_write_files on Windows (add zip extract test)

Open cielavenir opened this issue 2 years ago • 11 comments

This temporal pull request simply adds zip version of "can strip components if desired" test, but it raises "4821 in central directory, 4972 in local header" on Windows. It is not related to password, so super-strange.

Could you take a look? @gaborcsardi

cielavenir avatar Nov 29 '22 03:11 cielavenir

calling archive_write_close is not sufficient

cielavenir avatar Nov 29 '22 06:11 cielavenir

@cielavenir Thanks, I can take a look later today.

gaborcsardi avatar Nov 29 '22 07:11 gaborcsardi

The thing is, is my library usage is wrong or is there potential problem on this library?

cielavenir avatar Dec 15 '22 10:12 cielavenir

Hello @gaborcsardi , it turned out that open() argument requires O_BINARY on Windows. I have not checked in detail but it is possible that on Windows archive_write_files would not be working from the beginning.

I added integrity check to avoid this kind of accident further.

cielavenir avatar Feb 02 '23 12:02 cielavenir

Simply adding integrity check to tar failed as https://github.com/r-lib/archive/actions/runs/4074516161 This means tar content was corrupted.

cielavenir avatar Feb 02 '23 12:02 cielavenir

now it is ready.

cielavenir avatar Feb 02 '23 12:02 cielavenir

hi, is cf0b568 good or still bad

cielavenir avatar Feb 10 '23 00:02 cielavenir

I think it is good.

gaborcsardi avatar Feb 10 '23 08:02 gaborcsardi

I don't think there are remaining issue here

cielavenir avatar Feb 22 '23 02:02 cielavenir

are there still anything interfering merging?

cielavenir avatar Apr 10 '23 09:04 cielavenir

This one should be ready, could you merge or are there any issues?

cielavenir avatar Jun 19 '23 00:06 cielavenir

I'm tired, converted to issue https://github.com/r-lib/archive/issues/98

cielavenir avatar Mar 18 '24 00:03 cielavenir

alternatively we can use #ifndef O_BINARY

cielavenir avatar Mar 18 '24 01:03 cielavenir