Ouch. Letting people write data to where they can't get it back from seems double-plus ungood.
Robert, yes, I agree with you. This is exactly what I wanted to say. I've implemented a stream class in C++ and this circumstance makes the code not so clean because I need to take into account the behavior of lo_write() and 2GB limit.