Tar Module - Extract tar files with Corona

  1. is it an umcompressed tar?
  2. did you use this program for making the tar http://www.izarc.org/download.html
  3. have your tried it from the temporary directory instead of the the cache folder?
  4. have your tried the original tar.lua from danny, http://www.infuseddreams.com/apps/Tar_Lib.zip?
  5. have you tried with out the subfolders?
  6. maybe take out all non-abc characters from filenames.

if you want to post your tar file or an example of it i will try to duplicate your error.

it has always worked well for me on win sim, mac sim, ios,andriod. so i am unclear in what the problem might be. [import]uid: 89663 topic_id: 23242 reply_id: 131137[/import]

1. is it an umcompressed tar?
Yes

2. did you use this program for making the tar http://www.izarc.org/download.html
No, I used the tar from the command line. I know that was mentioned as a problem, but I also was hoping it would have been addressed.

3. have your tried it from the temporary directory instead of the the cache folder?
No. But I’ll give that a try, at least for the source folder. The un-tarred filed will have to go to Caches since Apple won’t let me unpack downloaded content to Documents.

4. have your tried the original tar.lua from danny, http://www.infuseddreams.com/apps/Tar_Lib.zip?
No.

5. have you tried with out the subfolders?
If it wont’ work with directories, I can’t use this solution.

6. maybe take out all non-abc characters from filenames.
This is impractical as well.

Thanks for the suggestions.
[import]uid: 19626 topic_id: 23242 reply_id: 131162[/import]

Well I solved this problem. Seems that in tar.lua, it was setting a variable called “destDir” and it was only considering system.DocumentsDirectory and system.TemporaryDirectory as valid possibilities. I’ve expanded it to cover system.CachesDirectory and all is fine.

Now if it could just deal with compressed files…
[import]uid: 19626 topic_id: 23242 reply_id: 131278[/import]

@ rob

i am using 2012.894 public build.

i tried this last night https://github.com/mimetic/tar.lua.git with no success, on osx it appears to finish its processing but makes no files or directories. it never enters this line of code in tar.lua, all header.typeflag shows as a filename even if its a directory.

 if header.typeflag == "directory" then  
  
 print('driectory')  
 lfs.mkdir( pathname )  

On xp there is the forward/backslashes issue with lfs, probably could replace all slashes in the file-path string but never got that far, i had to do this before with something else.

and at the moment i am not doing device builds.

i know its not ideal, but when i first used tar with corona it did not have directory support so i just prefix everything as the directory name that i wanted, it help with clutter a little bit, example:

images\_lock,  
images\_bug,  
music\_backgrouund,   
sub1\_datafile,  
sub1\_updatemenu,  

I will look into it some more but maybe some others could tell us what corona builds they used, and the process they used to make their tar files for this to work successfully.

[import]uid: 89663 topic_id: 23242 reply_id: 131280[/import]

@ rob

sorry didn’t read your post first. congrats on getting it to work. [import]uid: 89663 topic_id: 23242 reply_id: 131281[/import]

Here is the output of “diff” if any one wants it:

154,155d153  
\< elseif destdir == system.CachesDirectory then  
\< destPath = system.pathForFile("", system.CachesDirectory)  

I’m assuming both versions have this issue.

Rob
[import]uid: 19626 topic_id: 23242 reply_id: 131291[/import]

Well I solved this problem. Seems that in tar.lua, it was setting a variable called “destDir” and it was only considering system.DocumentsDirectory and system.TemporaryDirectory as valid possibilities. I’ve expanded it to cover system.CachesDirectory and all is fine.

Now if it could just deal with compressed files…
[import]uid: 19626 topic_id: 23242 reply_id: 131278[/import]

@ rob

i am using 2012.894 public build.

i tried this last night https://github.com/mimetic/tar.lua.git with no success, on osx it appears to finish its processing but makes no files or directories. it never enters this line of code in tar.lua, all header.typeflag shows as a filename even if its a directory.

 if header.typeflag == "directory" then  
  
 print('driectory')  
 lfs.mkdir( pathname )  

On xp there is the forward/backslashes issue with lfs, probably could replace all slashes in the file-path string but never got that far, i had to do this before with something else.

and at the moment i am not doing device builds.

i know its not ideal, but when i first used tar with corona it did not have directory support so i just prefix everything as the directory name that i wanted, it help with clutter a little bit, example:

images\_lock,  
images\_bug,  
music\_backgrouund,   
sub1\_datafile,  
sub1\_updatemenu,  

I will look into it some more but maybe some others could tell us what corona builds they used, and the process they used to make their tar files for this to work successfully.

[import]uid: 89663 topic_id: 23242 reply_id: 131280[/import]

@ rob

sorry didn’t read your post first. congrats on getting it to work. [import]uid: 89663 topic_id: 23242 reply_id: 131281[/import]

Here is the output of “diff” if any one wants it:

154,155d153  
\< elseif destdir == system.CachesDirectory then  
\< destPath = system.pathForFile("", system.CachesDirectory)  

I’m assuming both versions have this issue.

Rob
[import]uid: 19626 topic_id: 23242 reply_id: 131291[/import]

Rob, can you please share how to “tar” files from a command line on a Mac? do I need to install anything or is it a native feature on the macs?

thanks a lot,
Alex

*** I FOUND IT ***
However, having use the Terminal line to (uncompressed) tar my file:
tar -cvf test.tar /path

i am still getting an error while trying to untaring it. Ideas?

Taking advantage, is there a way to use the native tar from outside the Terminal window? I am thinking on a batch file or something. [import]uid: 4883 topic_id: 23242 reply_id: 134181[/import]

I’ve never worked with Mac automator scripts, but that’s a possibility since it can execute commands. [import]uid: 199310 topic_id: 23242 reply_id: 134223[/import]

Rob, can you please share how to “tar” files from a command line on a Mac? do I need to install anything or is it a native feature on the macs?

thanks a lot,
Alex

*** I FOUND IT ***
However, having use the Terminal line to (uncompressed) tar my file:
tar -cvf test.tar /path

i am still getting an error while trying to untaring it. Ideas?

Taking advantage, is there a way to use the native tar from outside the Terminal window? I am thinking on a batch file or something. [import]uid: 4883 topic_id: 23242 reply_id: 134181[/import]

I’ve never worked with Mac automator scripts, but that’s a possibility since it can execute commands. [import]uid: 199310 topic_id: 23242 reply_id: 134223[/import]

Does anyone want a paid job to implement this for me? My apk file size is just over 100MB and of the Android store only allows apks of 50MB. In all honesty how to implement this and make it work has gone over my head (I’m still new to this) so I’ve posted this job if anyone want a bit of spare change for implementing this for my app:

https://developer.coronalabs.com/forum/2012/12/19/paid-job-need-someone-help-me-get-my-100mb-app-android-app-store-possible-using

If anyone wants to provide a step by step guide even better, but either is welcome :slight_smile: [import]uid: 187132 topic_id: 23242 reply_id: 135788[/import]

Does anyone want a paid job to implement this for me? My apk file size is just over 100MB and of the Android store only allows apks of 50MB. In all honesty how to implement this and make it work has gone over my head (I’m still new to this) so I’ve posted this job if anyone want a bit of spare change for implementing this for my app:

https://developer.coronalabs.com/forum/2012/12/19/paid-job-need-someone-help-me-get-my-100mb-app-android-app-store-possible-using

If anyone wants to provide a step by step guide even better, but either is welcome :slight_smile: [import]uid: 187132 topic_id: 23242 reply_id: 135788[/import]

update the code in tar.lua for using CachesDirectory

if destdir == system.DocumentsDirectory then destPath = system.pathForFile("", system.DocumentsDirectory) elseif destdir == system.TemporaryDirectory then destPath = system.pathForFile("", system.TemporaryDirectory) elseif destdir == system.CachesDirectory then destPath = system.pathForFile("", system.CachesDirectory) else destPath = destdir end [import]uid: 96683 topic_id: 23242 reply_id: 138751[/import]

update the code in tar.lua for using CachesDirectory

if destdir == system.DocumentsDirectory then destPath = system.pathForFile("", system.DocumentsDirectory) elseif destdir == system.TemporaryDirectory then destPath = system.pathForFile("", system.TemporaryDirectory) elseif destdir == system.CachesDirectory then destPath = system.pathForFile("", system.CachesDirectory) else destPath = destdir end [import]uid: 96683 topic_id: 23242 reply_id: 138751[/import]

I have a question about Android Expansion Files. I know that this feature is not supported yet, but is it possible to somehow decompile apk file, add some code that is needed (http://developer.android.com/google/play/expansion-files.html) and compile it again or I need Corona Enterprise service to do that?

P.S
Tried https://github.com/mimetic/tar.lua.git and it worked when I created tar file with 7-zip and changed:

header.magic = 'ustar '-- block:sub(258,263)  
header.version = '00'--block:sub(264,265)  

Maybe 7-zip doesn’t know how to add version and format name to file header but with code change everything works and untars even subdirectories.
I couldn’t make it work with IZArc. [import]uid: 117071 topic_id: 23242 reply_id: 141105[/import]

I have a question about Android Expansion Files. I know that this feature is not supported yet, but is it possible to somehow decompile apk file, add some code that is needed (http://developer.android.com/google/play/expansion-files.html) and compile it again or I need Corona Enterprise service to do that?

P.S
Tried https://github.com/mimetic/tar.lua.git and it worked when I created tar file with 7-zip and changed:

header.magic = 'ustar '-- block:sub(258,263)  
header.version = '00'--block:sub(264,265)  

Maybe 7-zip doesn’t know how to add version and format name to file header but with code change everything works and untars even subdirectories.
I couldn’t make it work with IZArc. [import]uid: 117071 topic_id: 23242 reply_id: 141105[/import]