Subject: | |
From: | |
Reply To: | |
Date: | Wed, 20 Dec 2000 13:41:43 -0800 |
Content-Type: | text/plain |
Parts/Attachments: |
|
|
Mark asks:
> When writing to a message file (variable length records, one reader) that
> has reached eof, the fwrite waits. Is there a way to make the fwrite fail
> insted of waiting?
I *think* that there's no way to avoid waiting on a write if there is a
reader. Message files are supposed to be a reliable queue mechanism, and so
block in this case. I suppose "make the file bigger" is not an acceptable
solution? Or can you arrange for the reader to close the file if it's not
going to be able to read messages for a while?
If there is no reader, then you'll get an EOF by default, but you can *make*
it block with FCONTROL 45 on the writing side. But there's no option that
I'm aware of to make the write fail if there is a reader.
Of course every time I think I know something about message files, they turn
around and surprise/bite me, such as the fact that there is only one "enable
reading of writer IDs and open/close records" flag that covers *all*
readers. So if one reader turns this option on, everyone sees the extra
info.
Message files are truly amazing and wonderful (and surprisingly complex)
things.
G.
|
|
|