HP3000-L Archives

December 2000, Week 3

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Gavin Scott <[log in to unmask]>
Reply To:
Gavin Scott <[log in to unmask]>
Date:
Wed, 20 Dec 2000 13:41:43 -0800
Content-Type:
text/plain
Parts/Attachments:
text/plain (26 lines)
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.

ATOM RSS1 RSS2