Steve Schveighoffer wrote:
----- Original Message ----
From: Andrei Alexandrescu <[email protected]>
Steve Schveighoffer wrote:
Second, you cannot do a tell on the file handle, because you need to take
into account the buffer.
My understanding is that calling fflush() before lseek should be fine. See my
upcoming commit.
I'll take a look. But I think you cannot do a relative seek or a tell (which is
a relative seek of 0) without taking into account the buffer.
Here is the issue:
1. you open a file.
2. you read 4 bytes. The FILE object reads 4096 because it wants to fill up its
buffer.
3. you do a tell, expecting 4. If the function does an lseek64 on the file
handle, it gets 4096.
I confirm this is the behavior. I finally found the way to do it on OSX
- import core.sys.posix.stdio and then use fseeko and ftello. See my
latest checkin.
Andrei
_______________________________________________
phobos mailing list
[email protected]
http://lists.puremagic.com/mailman/listinfo/phobos