cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Seek function

From: Georg Lippitsch <georg.lippitsch_at_gmx.at>
Date: Mon, 7 Jan 2008 09:44:21 +0100

Am Sonntag, 6. Januar 2008 23:44 schrieben Sie:

> Thanks a lot (and sorry for my delay in dealing with it)!

No problem!

> This patch doesn't apply against current CVS, can you please make it do so?
OK, I wrote it using 7.17.1, but will try to rewrite using lates CVS.

>
> I'm having second thoughts about the use for the 'origin' argument in the
> callback, seeing it uses SEEK_SET all over right now. Not only do I feel
> SEEK_SET is bad to use for our own callback (I would prefer CURL_SEEK_SET
> or similar), but since we can't see any use of any other origin right now
> perhaps we should go back to just do that in the seek function? (Oh and
> please don't hate me for leaning back and forth on this! :-O) Any further
> thoughts on this now when some time has gone by?

I think one advantage of this function is that it has the same signature as
fseek. Users can easily write a wrapper around it or even point to it
directly (at least on some systems), as curl already does with read/write
functions. This was also the reason for using SEEK_SET directly instead of
defining CURL_SEEK_SET.
Personally I don't care whether there is a an 'origin' argument, but beeing
consistent with fseek is IMO not a bad idea.
Received on 2008-01-07