Re: Cocoa framework or Object class to uncompress files

2022-10-25 Thread Carl Hoefs via Cocoa-dev
On Oct 25, 2022, at 12:12 AM, Markus Spoettl  wrote:
> 
> On 10/25/22 3:45 AM, Carl Hoefs via Cocoa-dev wrote:
>> My iOS app downloads a gzip'd data file into its sandbox that the app needs 
>> to unzip
>> and process. I don't see anything in Cocoa (such as NSFileManager) that 
>> addresses
>> uncompressing files. Is there a way?
>> (BTW, I tried some ancient 3rd party code called ZipArchive but it always 
>> fails trying
>> to parse the zipped file.)
>> I'm hoping there's a built-in solution or framework that I'm just 
>> overlooking.
> 
> I'm using an NSData extension that uses :
> 
> https://github.com/schacon/igithub/blob/master/CocoaGit/Util/NSData%2BCompression.m
> 
> Is very easy to use and works very well. You need to add "-lz" to the "Other 
> Linker Flags" linker option in the target build settings of your project.
> 
Wow, that works perfectly! And it handles both ZIP and GZIP! 
It's also efficient: It inflates a 120MB file in 0.28 secs. Awesome!

(BTW, I added "libz.tbd" to the project, and it works. But what is with the 
.tbd extension?)

Thanks so much for this, I was about to give up hope!

-Carl


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Cocoa framework or Object class to uncompress files

2022-10-25 Thread James Walker via Cocoa-dev

On 10/24/22 6:45 PM, Carl Hoefs via Cocoa-dev wrote:

My iOS app downloads a gzip'd data file into its sandbox that the app needs to 
unzip and process. I don't see anything in Cocoa (such as NSFileManager) that 
addresses uncompressing files. Is there a way?

(BTW, I tried some ancient 3rd party code called ZipArchive but it always fails 
trying to parse the zipped file.)

I'm hoping there's a built-in solution or framework that I'm just overlooking.

It's not clear whether you're aware that gzip and zip are not the same 
thing.  So if you take a gzip file and feed it to a zip decoder, that's 
not going to work.


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Cocoa framework or Object class to uncompress files

2022-10-25 Thread Markus Spoettl via Cocoa-dev

On 10/25/22 3:45 AM, Carl Hoefs via Cocoa-dev wrote:

My iOS app downloads a gzip'd data file into its sandbox that the app needs to 
unzip
and process. I don't see anything in Cocoa (such as NSFileManager) that 
addresses
uncompressing files. Is there a way?

(BTW, I tried some ancient 3rd party code called ZipArchive but it always fails 
trying
to parse the zipped file.)

I'm hoping there's a built-in solution or framework that I'm just overlooking.


I'm using an NSData extension that uses :

https://github.com/schacon/igithub/blob/master/CocoaGit/Util/NSData%2BCompression.m

Is very easy to use and works very well. You need to add "-lz" to the "Other Linker Flags" 
linker option in the target build settings of your project.


Regards
Markus
--
__
Markus Spoettl

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Cocoa framework or Object class to uncompress files

2022-10-24 Thread Quincey Morris via Cocoa-dev
No. There’s no solution there. The Archive framework makes uncompressing of raw 
data easy, including the compression format that’s normally used inside .zip 
files, but it doesn’t actually read .zip file format. The file format and the 
compression algorithm are, in effect, unrelated to each other.

It’s not extremely hard to read the .zip file format directly, though there’s 
not really a single standard of which parts of the spec actually need to be 
implemented. I implemented something based on this:

https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT

but the implementation is not mine to give away, sorry.

> On Oct 24, 2022, at 19:19, Marco S Hyman via Cocoa-dev 
>  wrote:
> 
>> I'm hoping there's a built-in solution or framework that I'm just 
>> overlooking.
> 
> Guess: The Apple Archive framework
> 
> https://developer.apple.com/documentation/applearchive

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Cocoa framework or Object class to uncompress files

2022-10-24 Thread Marco S Hyman via Cocoa-dev



> 
> I'm hoping there's a built-in solution or framework that I'm just overlooking.

Guess: The Apple Archive framework

https://developer.apple.com/documentation/applearchive


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Cocoa framework or Object class to uncompress files

2022-10-24 Thread Carl Hoefs via Cocoa-dev
My iOS app downloads a gzip'd data file into its sandbox that the app needs to 
unzip and process. I don't see anything in Cocoa (such as NSFileManager) that 
addresses uncompressing files. Is there a way?

(BTW, I tried some ancient 3rd party code called ZipArchive but it always fails 
trying to parse the zipped file.) 

I'm hoping there's a built-in solution or framework that I'm just overlooking.

-Carl

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com