[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: mingw lseek bug
From: |
Bruno Haible |
Subject: |
Re: mingw lseek bug |
Date: |
Mon, 28 May 2007 17:25:57 +0200 |
User-agent: |
KMail/1.5.4 |
Eric Blake wrote:
> Do we want to offer ftello(fp) as the shorter alternative to
> lseek(fileno(fp),0,SEEK_CUR) for testing seekability?
I don't think we can guarantee that, if we stick to the abstractions laid
out by POSIX. The ftello.html page says
"The ftell() function shall obtain the current value of the file-position
indicator for the stream pointed to by stream."
So clearly it talks about a property of the stream. I can see two situations
when ftello() would succeed although lseek() would always fail:
- A stream with an infinite-size buffer (a buffer growing as needed),
- An input stream that keeps track of the current position simply by
counting the number of bytes read so far - assuming no fflush() call
occurs.
Bruno
- Re: mingw lseek bug, (continued)
- Re: mingw lseek bug, Bruno Haible, 2007/05/24
- Re: mingw lseek bug, Eric Blake, 2007/05/24
- Re: mingw lseek bug, Eric Blake, 2007/05/24
- Re: mingw lseek bug, Bruno Haible, 2007/05/24
- Re: mingw lseek bug, Eric Blake, 2007/05/24
- Re: mingw lseek bug, Bruno Haible, 2007/05/28
- Re: mingw lseek bug, Eric Blake, 2007/05/28
- Re: mingw lseek bug, Bruno Haible, 2007/05/28
- Re: mingw lseek bug, Bruno Haible, 2007/05/28
- Re: mingw lseek bug, Eric Blake, 2007/05/28
- Re: mingw lseek bug,
Bruno Haible <=
- Re: mingw lseek bug, Eric Blake, 2007/05/28
- Re: mingw lseek bug, Bruno Haible, 2007/05/28
- Re: mingw lseek bug, Bruno Haible, 2007/05/28
- new module 'fseek' (Re: mingw lseek bug), Bruno Haible, 2007/05/28
- new module 'ftell' (was: Re: mingw lseek bug), Bruno Haible, 2007/05/28
Re: mingw lseek bug, Bruno Haible, 2007/05/24