Any one used minizip or libtar?

201 views
Skip to first unread message

Imskull

unread,
May 5, 2014, 3:53:00 AM5/5/14
to native-cli...@googlegroups.com
Hello guys,

I am trying to package one folder into a file, I found there was no such library in NACL API nor in naclports(they have a zlib, but I want a package library, eg: minizip), 
then I found minizip port for nacl at https://github.com/eugenis/zlib-nacl/tree/master/contrib/minizip , but I don't know how to integrate it into my project.

Finally, I tried to use libtar from naclports, I got an error when calling tar_append_file: " Function not implemented", after searching its source code, this error looks
raising from a lstat call. ( btw: I am using pepper 33)

Any one know is there a solution to package folder into a file in NACL?
thank you in advanced!

Matthew Turk

unread,
May 5, 2014, 8:20:56 AM5/5/14
to native-cli...@googlegroups.com
Hi,
You can use libtar like you're describing, but your tar file can't
include symbolic or hard links. I have run into a similar problem and
I was able to get around it by using --hard-dereference and -h to
dereference both hard and symbolic links.

-Matt

>
> --
> You received this message because you are subscribed to the Google Groups
> "Native-Client-Discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to native-client-di...@googlegroups.com.
> To post to this group, send email to native-cli...@googlegroups.com.
> Visit this group at http://groups.google.com/group/native-client-discuss.
> For more options, visit https://groups.google.com/d/optout.

Ben Smith

unread,
May 5, 2014, 12:38:14 PM5/5/14
to native-cli...@googlegroups.com
On Monday, May 5, 2014 12:53:00 AM UTC-7, Imskull wrote:
Hello guys,

I am trying to package one folder into a file, I found there was no such library in NACL API nor in naclports(they have a zlib, but I want a package library, eg: minizip), 
then I found minizip port for nacl at https://github.com/eugenis/zlib-nacl/tree/master/contrib/minizip , but I don't know how to integrate it into my project.

After you build zlib for naclports, they can also be found in your out directory:

naclports/out/build/zlib/zlib-1.2.8/contrib/minizip/

You just need to copy the unzip.*, zip.* and ioapi.* files to your project. They should build without too much trouble, though I did have to modify ioapi.h here:

@@ -21,7 +21,7 @@
 #ifndef _ZLIBIOAPI64_H
 #define _ZLIBIOAPI64_H
 
-#if (!defined(_WIN32)) && (!defined(WIN32)) && (!defined(__APPLE__))
+#if (!defined(_WIN32)) && (!defined(WIN32)) && (!defined(__APPLE__)) && (!defined(__native_client__))
 
   // Linux needs this to support file operation on files larger then 4+GB
   // But might need better if/def to select just the platforms that needs them.

minizip requires zlib, so you'll have to build that first. 

Imskull

unread,
May 6, 2014, 2:43:56 AM5/6/14
to native-cli...@googlegroups.com
It's good new some guy has build minizip success, seems not very difficult as you pointed out, I'll try it later, thank you.

Imskull

unread,
May 6, 2014, 2:56:36 AM5/6/14
to native-cli...@googlegroups.com
I am sure there is no symbolic link or hard link in my folder, I just created a mp3 in a folder mounted in html5fs under "/persistent", I tried to call lstat("/persistent/myfolder/my.mp3") directly, the error code said " Function not implemented".
if as Ben Smith said minizip could work, it's my first choice, if not I will try libtar again with you suggested options. thanks anyway.

Imskull

unread,
May 6, 2014, 7:58:16 PM5/6/14
to native-cli...@googlegroups.com
It works like a charm, here is additional changes I have made:
- add  "-DNOCRYPT -DIOAPI_NO_64" to your Makefile's CFLAGS
- disable compile  warning as error if you did not set.


On Tuesday, May 6, 2014 12:38:14 AM UTC+8, Ben Smith wrote:

Thor Tallmon

unread,
Dec 4, 2014, 1:02:28 PM12/4/14
to native-cli...@googlegroups.com
Sorry to necro this thread, but...

Out of curiosity, how were you addressing the minigzip file from the chrome app? were you using the whole postMessage thing?

I'm at a loss for how to pipe information to/from it :/
Reply all
Reply to author
Forward
0 new messages