haxe.zip.Uncompress not working for javascript?

조회수 253회
읽지 않은 첫 메시지로 건너뛰기

Nathan Hüsken

읽지 않음,
2016. 2. 1. 오전 8:54:3416. 2. 1.
받는사람 haxe...@googlegroups.com
Hey,

The documentation here says:
http://api.haxe.org/haxe/zip/Uncompress.html that uncompress is
available on all platforms.

But when I try to run haxe.zip.Reader.unzip from javascript, I get an
exception:

Uncompress.hx: Not implemented for this platform.

Is the documentation wrong?
Can I uncompress zips in javascript?

Thanks!
Nathan

clemos

읽지 않음,
2016. 2. 1. 오전 9:05:5716. 2. 1.
받는사람 haxe...@googlegroups.com
Hi,


BTW this whole haxe.zip.* vs format.zip.* vs _std.haxe.zip.* (vs format.tools.Inflate / Deflate, etc) APIs should be cleaned somehow.

++
Clément

Nathan

--
To post to this group haxe...@googlegroups.com
http://groups.google.com/group/haxelang?hl=en
---
You received this message because you are subscribed to the Google Groups "Haxe" group.
For more options, visit https://groups.google.com/d/optout.

Nathan Hüsken

읽지 않음,
2016. 2. 1. 오후 12:43:1216. 2. 1.
받는사람 haxe...@googlegroups.com
Hey,

Looking at:
https://github.com/HaxeFoundation/format/blob/master/format/zip/Reader.hx

I read:


#if haxe3

typedef Reader = haxe.zip.Reader;

#else
...


So it does not really make a difference. And If I try it out I get the
same error.

I can not find any implementation for javascript. Am I missing something?

Thanks!
Nathan

On 01.02.2016 15:05, clemos wrote:
> Hi,
>
> You should try using
> format: https://github.com/HaxeFoundation/format/blob/master/format/zip/Reader.hx
>
> BTW this whole haxe.zip.* vs format.zip.* vs _std.haxe.zip.* (vs
> format.tools.Inflate / Deflate, etc) APIs should be cleaned somehow.
>
> ++
> Clément
>
> On Mon, Feb 1, 2016 at 2:54 PM, Nathan Hüsken <nathan....@posteo.de
> <mailto:nathan....@posteo.de>> wrote:
>
> Hey,
>
> The documentation here says:
> http://api.haxe.org/haxe/zip/Uncompress.html that uncompress is
> available on all platforms.
>
> But when I try to run haxe.zip.Reader.unzip from javascript, I get an
> exception:
>
> Uncompress.hx: Not implemented for this platform.
>
> Is the documentation wrong?
> Can I uncompress zips in javascript?
>
> Thanks!
> Nathan
>
> --
> To post to this group haxe...@googlegroups.com
> <mailto:haxe...@googlegroups.com>

Justin L Mills

읽지 않음,
2016. 2. 1. 오후 8:44:5316. 2. 1.
받는사람 haxe...@googlegroups.com
I am sure I found it was not implemented in the past for Javascript only
c++ and neko but that could have changed.

I don't know anything about webworkers but something like this looks
portable maybe then make a request for MIT license from authors?

https://github.com/gildas-lormeau/zip.js/blob/master/WebContent/inflate.js

Not clear if it's structured quite the same as the "format" structures
but perhaps it would give inspiration. Or maybe just use it untyped.

underscorediscovery

읽지 않음,
2016. 2. 1. 오후 10:40:0916. 2. 1.
받는사람 Haxe
I use haxe.zip.Uncompress.run(compressed_bytes); without any trouble on the js target.

For input I use haxe.zip.Compress.run(source_bytes, 9);

I also found it odd that throw exists in the std lib but the above seemed to do what I needed.

Nathan Hüsken

읽지 않음,
2016. 2. 2. 오전 8:20:1016. 2. 2.
받는사람 haxe...@googlegroups.com
Hey,

Thanks for the tip. So you do:

haxe.zip.Uncompress.run(entry.data)

where entry is is part of an array, returned by haxe.zip.Reader.readZip?

If I do that, I get:

Uncaught Error: Invalid datahaxe_zip_InflateImpl.inflateLoop @
InflateImpl.hx:259haxe_zip_InflateImpl.readBytes @
InflateImpl.hx:151haxe_zip_InflateImpl.run @
InflateImpl.hx:368haxe_zip_Uncompress.run @
Uncompress.hx:41xlsx_XLSX.modifyXlsx @ XLSX.hx:119(anonymous function) @
AssignmentListDisplay.hx:103tink_core__$Callback_CallbackList_$Impl_$.invoke
@ Callback.hx:62tink_core_FutureTrigger.trigger @
Future.hx:164req.onreadystatechange @ Utils.hx:33

Idea on that?

Thanks!
Nathan

On 02.02.2016 04:40, underscorediscovery wrote:
> I use *haxe.zip.Uncompress.run(compressed_bytes); *without any trouble
> on the js target.
>
> For input I use *haxe.zip.Compress.run(source_bytes, 9);*
> *
> *
> <nathan....@posteo.de <javascript:>
> > <mailto:nathan....@posteo.de <javascript:>>> wrote:
> >
> > Hey,
> >
> > The documentation here says:
> > http://api.haxe.org/haxe/zip/Uncompress.html
> <http://api.haxe.org/haxe/zip/Uncompress.html> that uncompress is
> > available on all platforms.
> >
> > But when I try to run haxe.zip.Reader.unzip from javascript, I
> get an
> > exception:
> >
> > Uncompress.hx: Not implemented for this platform.
> >
> > Is the documentation wrong?
> > Can I uncompress zips in javascript?
> >
> > Thanks!
> > Nathan
> >
> > --
> > To post to this group haxe...@googlegroups.com <javascript:>
> > <mailto:haxe...@googlegroups.com <javascript:>>
> > http://groups.google.com/group/haxelang?hl=en
> <http://groups.google.com/group/haxelang?hl=en>
> > ---
> > You received this message because you are subscribed to the
> Google
> > Groups "Haxe" group.
> > For more options, visit https://groups.google.com/d/optout
> <https://groups.google.com/d/optout>.
> >
> >
> > --
> > To post to this group haxe...@googlegroups.com <javascript:>
> > http://groups.google.com/group/haxelang?hl=en
> <http://groups.google.com/group/haxelang?hl=en>
> > ---
> > You received this message because you are subscribed to the Google
> > Groups "Haxe" group.
> > For more options, visit https://groups.google.com/d/optout
> <https://groups.google.com/d/optout>.

Sven Bergström

읽지 않음,
2016. 2. 2. 오후 2:23:2516. 2. 2.
받는사람 haxe...@googlegroups.com
No I don't use any other zip api calls for what I need.
I think the end result is different, I'm merely compressing/uncompressing bytes, I don't make a zip file or entries from it or anything. 
I wanted to just mention the compress/uncompress part worked as I expected, and I found it odd the throw exists in standard lib too :)

For clarity, to compress/uncompress as I am:

var source_data: haxe.io.Bytes = ....; 
var compressed_data = haxe.zip.Compress.run(
source_data, 9);

...

var source_data = haxe.zip.Uncompress.run(compressed_data);


You received this message because you are subscribed to a topic in the Google Groups "Haxe" group.

Nathan Hüsken

읽지 않음,
2016. 2. 2. 오후 5:48:0016. 2. 2.
받는사람 haxe...@googlegroups.com
Ok, thanks.

I converted my zip files now to use no compression. Works for now, but
being able to uncompress would be nice.

Best Regards and Thanks!
Nathan

Daniel Uranga

읽지 않음,
2016. 2. 4. 오후 4:17:3016. 2. 4.
받는사람 haxe...@googlegroups.com
This one https://github.com/nodeca/pako looks really nice. Maybe using
externs for that would be a better solution.

Nathan Hüsken

읽지 않음,
2016. 2. 4. 오후 5:10:4416. 2. 4.
받는사람 haxe...@googlegroups.com
Thanks for the link. I will try it.
전체답장
작성자에게 답글
전달
새 메시지 0개