cURL / Mailing Lists / curl-users / Single Mail

curl-users

RE: curl.exe: append logs on the output-file?

From: Christoph Brunner <news_chbr0001_at_yahoo.de>
Date: Thu, 28 Mar 2002 13:22:24 +0100

I didn't want to use the '>>' to log into the logfile.
I had changed the following location of src/main.c:
I changed:
out->filename,"wb");
to
 out->filename,"ab");

And it works ;-)
Is there anything that influences this change negatively?

int my_fwrite(void *buffer, size_t size, size_t nmemb, void *stream)
{
  struct OutStruct *out=(struct OutStruct *)stream;
  if(out && !out->stream) {
    /* open file for writing */
    //Christoph Brunner 28.02.2002
    out->stream=fopen(out->filename, "ab");
    //out->stream=fopen(out->filename, "wb");

*********** REPLY SEPARATOR ***********

On 28.03.2002 at 06:29 Roth, Kevin P. wrote:
The problem here is that --output is what's not appending... So this change isn't going to fix Christoph's problem (since he's using --output to stick results into a file).

What you really need is this:

    curl.exe URL 2>&1 >> logfile.txt

or, if the 2>&1 doesn't work for some reason:

    curl.exe --stderr - URL >> logfile.txt

leave off the --output altogether...

If, on the other hand, you actually want separate message and error files, then try something like this:

    curl.exe URL >> logfile.txt 2>> errors.txt

--Kevin

-----Original Message-----
From: Daniel Stenberg [mailto:daniel_at_haxx.se]
Sent: Thu 28-Mar-02 05:23 AM

Thinking about it, I figure --stderr should actually always append. Anyone
with a different opinion? Please don't tell me we need both. ;-)

src/main.c line 1096 should be modified so that the fopen() uses an "a"
instead of "w" for this to work...

_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com
Received on 2002-03-28