8000 example_recursive will lost some special characters · Issue #296 · rubyzip/rubyzip · GitHub
[go: up one dir, main page]

Skip to content

example_recursive will lost some special characters #296

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
EagleSHCN opened this issue Aug 15, 2016 · 1 comment
Closed

example_recursive will lost some special characters #296

EagleSHCN opened this issue Aug 15, 2016 · 1 comment

Comments

@EagleSHCN
Copy link
Contributor

I've run the example_recursive with some binary files , but after extract I found some files will lost special characters ( for example 0x1a is lost at file end ) .

Modify
def put_into_archive(disk_file_path, io, zip_file_path) io.get_output_stream(zip_file_path) do |f| f.write(File.open(disk_file_path, 'rb').read) end end

to
def put_into_archive(disk_file_path, io, zip_file_path) io.add(zip_file_path, disk_file_path) end

could fix this issue .

EagleSHCN added a commit to EagleSHCN/rubyzip that referenced this issue Aug 15, 2016
…in file

example_recursive.rb lost some special characters ( for example 0x1a at file end ) , it should related to io stream implementation . Use internal zip add method instead of File.read could avoid this lose . 

An issue is posted at rubyzip#296
@jdleesmiller
Copy link
Member

It looks like this was fixed in #297, so I'll close out the issue.

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

No branches or pull requests

2 participants
0