Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@jefferis
Copy link
Contributor

Dear @gaborcsardi,

I wonder if you would consider a small pull request that optionally returns extra information about the zip file, specifically the crc32 and file offset for each zip entry. I have a project where I need this information in order to rapidly access entries inside very big zip files. Since I have made this information optional at the C level, I think it is harmless and could be useful for other people.

For the test file, we see:

> zip_list(zipfile)
                filename compressed_size uncompressed_size
1      file44da61c6bfac/               0                 0
2 file44da61c6bfac/file1              15                10
3 file44da61c6bfac/file2              16                11
            timestamp permissions
1 2021-03-13 20:40:38         755
2 2021-03-13 20:40:38         644
3 2021-03-13 20:40:38         644
> zip_list(zipfile, extra = T)
                filename compressed_size uncompressed_size
1      file44da61c6bfac/               0                 0
2 file44da61c6bfac/file1              15                10
3 file44da61c6bfac/file2              16                11
            timestamp permissions    crc32 offset
1 2021-03-13 20:40:38         755 00000000      0
2 2021-03-13 20:40:38         644 00effe3a     47
3 2021-03-13 20:40:38         644 735af9a0    130

Do you think you can consider a PR?

With many thanks, Greg

@jefferis jefferis changed the title Feature/ziplist crc32 and offset Teach ziplist to return crc32 and offset (optionally) Mar 13, 2021
@jefferis
Copy link
Contributor Author

Please note I have not processed the updated roxygen help block since you seem to have a special setup for that.

@jefferis
Copy link
Contributor Author

AFAICS the only issue in the check is the expected doc mismatch

Codoc mismatches from documentation object 'zip_list':
  zip_list
    Code: function(zipfile, extra = FALSE)
    Docs: function(zipfile)
    Argument names in code not in docs:
      extra

Copy link
Member

@gaborcsardi gaborcsardi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I don't think we need the extra argument, we can just always return the extra columns.

@gaborcsardi
Copy link
Member

@jefferis Please also add an entry to NEWS.md, mentioning yourself, and this PR. Thanks!

@jefferis
Copy link
Contributor Author

Thanks for the quick review @gaborcsardi! I've added the NEWS entry, so that should just leave:

  • roxygenise
  • redown

when you are ready to merge.

@gaborcsardi
Copy link
Member

Looks great, thanks!

@gaborcsardi gaborcsardi merged commit e692e37 into r-lib:master Mar 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants