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

Skip to content
Tempfile problems on Windows #410
Closed
Closed
@philsp1

Description

@philsp1

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0