[Tutor] Simultaneous read and write on file

Cameron Simpson cs at zip.com.au
Tue Jan 19 00:34:52 EST 2016


On 18Jan2016 20:41, Martin A. Brown <martin at linux-ip.net> wrote:
>>> Yes and so have I. Maybe twice in 30 years of programming. [...]
>>
>> I may have done it a little more than that; I agree it is very
>> rare. I may be biased because I was debugging exactly this last
>> week. (Which itself is an argument against mixed rerad/write with
>> one file - it was all my own code and I spent over a day chasing
>> this because I was looking in the wrong spot).
>
>Oh yes.  Ooof.  Today's decisions are tomorrow's albatross.

Actually I have good reason to mix these in this instance, and now that it is 
debugged it is reliable and more efficient to boot.

[...]
>>>> Tip for new players: if you do any .write()s, remember to do a
>>>> .flush() before doing a seek or a read
>>>
>>> That's exactly my point. There are so many things you have to do
>>> extra when working in mixed mode. Too easy to treat things like
>>> normal mode files and get it wrong. Experts can do it and make it
>>> work, but mostly it's just not needed.
>>
>> Yes. You're write - for simplicity and reliability two distinct
>> open file instances are much easier.
>
>Yes, he's write [sic].  He writes a bunch!  ;)

Alas, I have a tendency to substitute homophones, or near homophones, when 
typing in a hurry. You'll see this in a bunch of my messages. More annoyingly, 
some are only visible when I reread a posted message instead of when I was 
proofreading prior to send.

>[Homonyms mess me up when I'm typing, all sew.]

Homonyms too.

Cheers,
Cameron Simpson <cs at zip.com.au>


More information about the Tutor mailing list