cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: libcurl putting empty file on Mac OS X

From: Josh Anon <josha_at_pixar.com>
Date: Wed, 17 Dec 2003 08:46:50 -0800

> Now, this is an interesting difference. There's no Content-Length:
> header here
> in the log from your program! It should be.
ok, should i add this manually?

>> curl_easy_setopt(curl, CURLOPT_INFILESIZE, ftell(inFile));
>
> I doubt this works on any platform. ftell() returns the "seek
> position" in the
> file so far, and this will be 0 in this case. Setting a zero byte file
> size is
> not a good idea here!
yeah, this was the last thing I tried before emailing (saw it in some
3rd party curl example), and I forgot to switch back to the struct stat
st_size method used in the example. Using st_size put an empty file,
too, even though the size was nonzero.

thanks,
Josh

---
Josh Anon
Studio Tools, Pixar Animation Studios
josha_at_pixar.com
-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
Received on 2003-12-17