cURL / Mailing Lists / curl-users / Single Mail

curl-users

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

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Tue, 2 Apr 2002 09:07:37 +0200 (MET DST)

On Thu, 28 Mar 2002, Christoph Brunner wrote:

> 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");

You can of course do this to change the behavior of your curl tool. I don't
want that change to get applied to the main source though, as I don't think
most people want to append by default and I don't approve of modified
behaviors without very good reasons! ;-)

If you would introduce a new option that would replace --output, which would
do this, then I'd be a happy man and probably go for adding this to the CVS
tree.

-- 
    Daniel Stenberg -- curl groks URLs -- http://curl.haxx.se/
Received on 2002-04-02