[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] fclose: don't fail on non-seekable input stream
From: |
Eric Blake |
Subject: |
Re: [PATCH] fclose: don't fail on non-seekable input stream |
Date: |
Mon, 02 May 2011 11:29:33 -0600 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110428 Fedora/3.1.10-1.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.10 |
On 05/02/2011 08:40 AM, Eric Blake wrote:
>> ! @item
>> ! @code{fflush} on an input stream changes the position of the stream to the
>> ! end of the previous buffer, on some platforms: mingw.
>>
>> Likewise not relevant: the position of the stream is irrelevant in fclose().
>
> Yes it is. test-closein has a test that validates that:
>
> { test-closein consume; cat; } < file
>
> outputs the remainder of file after the 6 bytes consumed by test-closein.
Then again, the GPL 'closein' module depends on fflush, so in the spirit
of modularity, fclose in isolation need not guarantee file offset as
long as fclose+fflush does. I'm still testing patches...
--
Eric Blake address@hidden +1-801-349-2682
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature