Philip Warner wrote:
> At 09:45 PM 23/10/2002 -0400, Bruce Momjian wrote:
> >We have to write another function because fsetpos doesn't do SEEK_CUR so
> >you have to implement it with more complex code. It isn't a drop in
> >place thing.
>
> The only code that uses SEEK_CUR is the code to check if seek is available
> - I am ver happy to change that to SEEK_SET - I can't even recall why I
> used SEEK_CUR. The code that does the real seeks uses SEEK_SET.
There are other problems. fgetpos() expects a pointer to an fpos_t,
while ftello just returns off_t, so you need a local variable in the
function to pass to fgetpos() and they return that from the function.
It is much cleaner to just duplicate the entire API so you don't have
any limitations or failure cases.
-- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610)
359-1001+ If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square,
Pennsylvania19073