Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

fseek

18 views
Skip to first unread message

Martin Jul

unread,
Jul 31, 1996, 3:00:00 AM7/31/96
to

Does anyone know how fast a fseek call is? If you're fseek'ing in a
large file, does the operating system read all data from the current
position to point you're fseek'ing to, or does it apply some clever
algorithm to jump right to the desired location? Does fseek use
constant, logarithmic or linear time?


Regards,

--
Martin Jul (marti...@yr.dk)
Young & Rubicam Interactive

David Luner

unread,
Aug 2, 1996, 3:00:00 AM8/2/96
to

Martin Jul <marti...@yr.dk> wrote:

>Does anyone know how fast a fseek call is?

Fast enough.

> If you're fseek'ing in a
>large file, does the operating system read all data from the current
>position to point you're fseek'ing to, or does it apply some clever
>algorithm to jump right to the desired location?

FSEEK just updates some pointers. No data is read. That's how you do
sparse files.

> Does fseek use
>constant, logarithmic or linear time?

FSEEK, for all practical purposes, always runs in constant time.

-- David

0 new messages