On Sun, Dec 12, 2010 at 13:34, John C. Randolph wrote:
> You don't need to launch a separate task for this. Just use Pierre-Olivier
> LaTour's NSData category:
>
> http://code.google.com/p/polkit/
Careful - that code is GPL licensed.
___
Cocoa-dev mai
You don't need to launch a separate task for this. Just use Pierre-
Olivier LaTour's NSData category:
http://code.google.com/p/polkit/
" • NSData+GZip adds gzip compression / decompression methods to NSData"
-jcr
___
Cocoa-dev mailing list (Cocoa
a (not a zip file) to a NSData.
> In other words, I have to zip and unzip "data to data", without using any
> file. Some idea?
>
> -- Leonardo
>
>
>
>> Da: Ben Haller
>> Data: Sun, 28 Nov 2010 08:52:33 -0500
>> A: Leonardo , Cocoa List
>&g
On Nov 28, 2010, at 3:51 PM, Leonardo wrote:
>
> Great! Thanks for the advises.
> Now I have to zip and unzip a NSData (not a zip file) to a NSData.
> In other words, I have to zip and unzip "data to data", without using any
> file. Some idea?
Use zlib directly. It's not too hard to compress buff
On Sun, Nov 28, 2010 at 3:12 PM, glenn andreas wrote:
> A quick google search turns up several Cocoa zip frameworks out there that
> will avoid having to use NSTask, etc... all together. While the zip file
> format is ugly, it is documented and you can always write your own to walk
> through a
On Nov 28, 2010, at 4:51 PM, Leonardo wrote:
> Great! Thanks for the advises.
> Now I have to zip and unzip a NSData (not a zip file) to a NSData.
> In other words, I have to zip and unzip "data to data", without using any
> file. Some idea?
>
> -- Leonardo
A quick google search turns up sever
onardo , Cocoa List
> Oggetto: Re: NSTask with unzip
>
> Yes, this looks good. I like your category on NSFileHandle (not a
> subclass!); it's cleaner than the code at the link I sent you, since it
> doesn't just eat the error, and it's better as a category.
>
>
continue;
>}
>if (returnError)
> *returnError = e;
>return nil;
>}
>@throw;
>}
>}
> }
> @end
>
>
>> Da: Ben Haller
>> Data: Sat, 27 Nov 2010 12:
*returnError = e;
return nil;
}
@throw;
}
}
}
@end
> Da: Ben Haller
> Data: Sat, 27 Nov 2010 12:12:39 -0500
> A: Dave DeLong
> Cc: "gMail.com" , Cocoa List
>
> Oggetto: Re: NSTask with unzip
>
>
Something along the lines of:
NSString * tempFilePath = [NSTemporaryDirectory()
stringByAppendingPathComponent:@"myTempFile.tmp"];
if (![[NSFileManager defaultManager] fileExistsAtPath:tempFilePath]) {
[[NSFileManager defaultManager] createFileAtPath:tempFilePath contents:nil
attributes:nil];
a: Sat, 27 Nov 2010 08:48:34 -0800
> A: Ben Haller
> Cc: "gMail.com" , Cocoa List
>
> Oggetto: Re: NSTask with unzip
>
> The way I get around this is to use an NSFileHandle for standard out instead
> of an NSPipe. It's a bit less efficient, but slightly more conv
What Scott said. I use NSFileManager to create a file in
NSTemporaryDirectory(), then point an NSFileHandle to that file for writing.
That NSFileHandle becomes the standard out of the task, and all the output of
the task is written to the file, which I can then peruse and reuse later at my
co
On Nov 27, 2010, at 10:12 AM, Ben Haller wrote:
>
> NSPipe uses NSFileHandle. Does using an NSFileHandle directly change things
> somehow? If so, why?
NSPipe uses pipes, which act sort of like files, except for that buffering
thing, enough so that they can be accessed through the same interfa
Here's a post that I found useful:
http://dev.notoptimal.net/2007/04/nstasks-nspipes-and-deadlocks-when.html
Dave, not sure what you mean here. NSPipe uses NSFileHandle. Does using an
NSFileHandle directly change things somehow? If so, why? I think this is an
avenue I haven't explored;
The way I get around this is to use an NSFileHandle for standard out instead of
an NSPipe. It's a bit less efficient, but slightly more convenient.
Dave
Sent from my iPhone
On Nov 27, 2010, at 7:59 AM, Ben Haller wrote:
> On 2010-11-26, at 7:33 AM, gMail.com wrote:
>
>> Hi, I can properly u
On 2010-11-26, at 7:33 AM, gMail.com wrote:
> Hi, I can properly unzip a zip file launching a NSTask with /usr/bin/unzip
> The task saves the unzipped file to the disk, then a I read the unzipped
> file in a NSData. Well. My question is:
> Can I do the same job without saving the unzipped file to
Hi, I can properly unzip a zip file launching a NSTask with /usr/bin/unzip
The task saves the unzipped file to the disk, then a I read the unzipped
file in a NSData. Well. My question is:
Can I do the same job without saving the unzipped file to the disk?
I have tried to set the standard output to
17 matches
Mail list logo