bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] read-file: Avoid memory reallocations with seekable files.


From: Paul Eggert
Subject: Re: [PATCH] read-file: Avoid memory reallocations with seekable files.
Date: Tue, 03 Aug 2010 11:37:48 -0700
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.11) Gecko/20100713 Thunderbird/3.0.6

On 08/03/10 06:50, Giuseppe Scrivano wrote:
> if ((pos = fseek (stream, 0, SEEK_CUR)) == 0)

Surely this would be much, much slower if the file seeks slowly,
for example, if it is a tape drive.

It might be helpful to use fstat to find the file's type and size,
and to subtract the current file offset from its size
(for file types where st_size is applicable).



reply via email to

[Prev in Thread] Current Thread [Next in Thread]