cURL / Mailing Lists / curl-library / Single Mail

curl-library

Fwd: download an file on Mac OS X

From: Jürgen Keser <jkeser_at_computerworks.de>
Date: Mon, 11 Feb 2013 21:56:16 +0100

Hi Nick,

thanks for the fast reply.

1.
How can I save the .gz file on my mac? Is this the correct way how I try it?
Should it work with the code you've sent me? (fp = fopen("/Path/To/Some/Place/Writable/curl-7.29.0.tar.gz", "w");)
I am not in the office at the moment so I can test it tomorrow...

2.
The NSAlert Messages will be shown when i start the the Cocoa Application. So I think this should be correct.

3.
Sorry, this is the standard footer in my mails. Sure are you authorized :-).

Thanks,

Jürgen

Anfang der weitergeleiteten Nachricht:

> Von: Nick Zitzmann <nick_at_chronosnet.com>
> Betreff: Aw: download an file on Mac OS X
> Datum: 11. Februar 2013 20:51:13 MEZ
> An: libcurl development <curl-library_at_cool.haxx.se>
> Antwort an: libcurl development <curl-library_at_cool.haxx.se>
>
>
> On Feb 11, 2013, at 9:26 AM, Jürgen Keser <jkeser_at_computerworks.de> wrote:
>
>> Hi All,
>>
>> we use Mac OS X 10.8 and Xcode 4.5.2. Here we try now to create our first simple (Cocoa Application) example with the
>> curl-library. We will download an file with this library and place the downloaded file to a special place. Enclosed I'll send you
>> the code we use until now. The curl_easy_setopt functions return all true, but the file will not be downloaded.
>> Also the Cocoa Application will cause an crash at the end. Is there anyone out there who can help me?
>
> I noticed three problems immediately:
>
>> fp = fopen(outfilename,"curl-7.29.0.tar.gz");
>
> This is an illegal use of the fopen() function. Read the man page for more details, but you need to do something like this instead:
> fp = fopen("/Path/To/Some/Place/Writable/curl-7.29.0.tar.gz", "w");
>
>> if(CURLE_OK == (res = curl_easy_setopt(curl, CURLOPT_URL, url))){
>> NSAlert *alert = [[[NSAlert alloc] init] autorelease];
>
> The NSAlert class is part of the AppKit framework. If you want to use AppKit, you need to initialize it first by calling either NSApplicationMain() or NSApplicationLoad(). See Apple's documentation for more information.
>
> Also, you are autoreleasing an object without first creating an autorelease pool. Unless your tool is using GC (which is deprecated), you must first create an NSAutoreleasePool or use the @autoreleasepool directive before calling -autorelease.
>
>> This message is intended for the addressee only. It contains private and confidential information. The contents are not to be disclosed to anyone other than the addressee. Unauthorized recipients are requested to comply with the above and to inform the sender immediately of any errors in transmission by replying to this message and please delete it from your computer.
>
> I sure hope I'm an authorized recipient… :)
>
> Nick Zitzmann
> <http://www.chronosnet.com/>
>
>
> -------------------------------------------------------------------
> List admin: http://cool.haxx.se/list/listinfo/curl-library
> Etiquette: http://curl.haxx.se/mail/etiquette.html

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2013-02-11