8000 Tempfile problems on Windows · Issue #410 · rubyzip/rubyzip · GitHub
[go: up one dir, main page]

Skip to content

Tempfile problems on Windows #410

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
philsp1 opened this issue Sep 27, 2019 · 1 comment
Closed

Tempfile problems on Windows #410

philsp1 opened this issue Sep 27, 2019 · 1 comment

Comments

@philsp1
Copy link
philsp1 commented Sep 27, 2019

The same code used on Windows and Linux behaves differently.
Everything works fine on Linux, but on Windows I get errors when trying to open a stream from a zip file that includes a folder/directory name.

    10: from P:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/rubyzip-2.0.0/lib/zip/filesystem.rb:246:in `open'

     9: from P:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/rubyzip-2.0.0/lib/zip/filesystem.rb:573:in `get_output_stream'

     8: from P:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/rubyzip-2.0.0/lib/zip/file.rb:265:in `get_output_stream'

     7: from P:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/rubyzip-2.0.0/lib/zip/file.rb:265:in `new'

     6: from P:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/rubyzip-2.0.0/lib/zip/streamable_stream.rb:10:in `initialize'

     5: from P:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/rubyzip-2.0.0/lib/zip/streamable_stream.rb:10:in `new'

     4: from P:/Ruby26-x64/lib/ruby/2.6.0/tempfile.rb:131:in `initialize'

     3: from P:/Ruby26-x64/lib/ruby/2.6.0/tmpdir.rb:135:in `create'

     2: from P:/Ruby26-x64/lib/ruby/2.6.0/tempfile.rb:133:in `block in initialize'

     1: from P:/Ruby26-x64/lib/ruby/2.6.0/tempfile.rb:133:in `open'

P:/Ruby26-x64/lib/ruby/2.6.0/tempfile.rb:133:in `initialize': No such file or directory @ rb_sysopen - dvlp/proxy.local__PROJECT$h595f5a46$h4bbd$h4126$h86a6$hec01f155cb67_resource_com$dnomagic$dmagicdraw$duml_umodel$dshared_umodel$dsnapshot20190927-27860-1nww0sq (Errno::ENOENT)

If I alter line 6 in streamable_stream.rb to:
nil ##::File.dirname(zipfile)
Which in effect enables Tempfile to use the Dir.tempdir for temporary file location everything seems to work fine.

I would like to understand why the temporary file for Streamable objects is being placed it a local folder instead of just using the Dir.tempdir folder.

@hainesr
Copy link
Member
hainesr commented Sep 27, 2019

This does seem a bit odd. I'll have a think about this and work up a fix if I can't see any reason why this is currently set up the way that it is.

@jdleesmiller you can assign this to me if you like.

jdleesmiller added a commit that referenced this issue Oct 4, 2019
Clean up temp file usage and fix #410
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