Question about lseek/fseek

2011-07-04 Thread Martin Möller
Hi Hackers, Why does these function allow seeking beyond the EOF of a file in O_RDONLY/²rb² mode ? How does these function then signal the EOF correctly ? Seeking beyond the EOF makes sense for me in write-mode but not in read-only mode ! With Regards, Martin

Re: Question about lseek/fseek

2011-07-02 Thread Artem Belevich
On Sat, Jul 2, 2011 at 6:57 AM, Martin Möller wrote: > Hi Hackers, > > why does these function allow seeking beyond the EOF of a file in > O_RDONLY/²rb² mode ? Perhaps because the standard explicitly says that it's allowed: http://pubs.opengroup.org/onlinepubs/009695399/functions/lseek.html > Ho

Question about lseek/fseek

2011-07-02 Thread Martin Möller
Hi Hackers, why does these function allow seeking beyond the EOF of a file in O_RDONLY/²rb² mode ? How does these function then signal the EOF correctly ? Seeking beyond the EOF makes sense for me in write-mode but not in read-only mode ! With Regards, Martin