8000 Error in example_recursive.rb · Issue #260 · rubyzip/rubyzip · GitHub
[go: up one dir, main page]

Skip to content

Error in example_recursive.rb #260

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
p-kolacz opened this issue Nov 28, 2015 · 5 comments
Closed

Error in example_recursive.rb #260

p-kolacz opened this issue Nov 28, 2015 · 5 comments

Comments

@p-kolacz
Copy link

In rubyzip/samples/example_recursive.rb (

io.get_output_stream(zipFilePath) { |f| f.puts(File.open(diskFilePath, "rb").read())}
) it should be f.write. 'Puts' puts extra line in files, damaging them.

@pol0nium
Copy link
Contributor

+1

It damaged xlsx files when zipping them. I replaced the puts with a write and the file corruption disappeared.

@hainesr
Copy link
Member
hainesr commented Jan 18, 2016

Thanks for catching and confirming. Could you submit a PR?

pol0nium added a commit to pol0nium/rubyzip that referenced this issue Jan 20, 2016
pol0nium added a commit to pol0nium/rubyzip that referenced this issue Jan 20, 2016
Replacing 'puts' with 'write' as 'puts' was adding extra lines in files,
damaging them. Ref : rubyzip#260
@pol0nium
Copy link
Contributor

Done.

This may be a fix for https://github.com/rubyzip/rubyzip#modify-docx-file-with-rubyzip too ?

@emiddleton
Copy link

The example in the README.md still uses puts.

@jdleesmiller
Copy link
Member

It looks like this was fixed in #297.

And it looks like the README was fixed in #283 .

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

5 participants
0