Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!armadillo.cis.ohio-state.edu!lum From: lum@armadillo.cis.ohio-state.edu (Lum Johnson) Newsgroups: news.software.anu-news Subject: Re: Reading news in a thunderstorm is hazardous. Message-ID: Date: 24 Jul 89 20:00:26 GMT References: <430@decus.com.au> <6414@kuhub.cc.ukans.edu> Sender: news@tut.cis.ohio-state.edu Organization: The Ohio State University, IRCC/CIS Joint Computing Laboratory Lines: 36 > In article <430@decus.com.au>, sutton@decus.com.au (Colin Sutton) writes: >> I am always on teneterhooks reading news from home via dial-up modem, >> because if the line goes down, all the items I read are now unread again >> ... Couldn't the NEWSRC file be updated as the news is read? ... I assume >> that the file would be kept open, so it wouldn't take long to update. And >> news would be quicker to exit too - just close the file. Actually, the problem seems to be one of insufficient paranoia, and the approach you suggest is unfortunately exactly the one which would most exacerbate the problem, if it weren't already implemented. It seems that the file is already being kept open - and when something unexpected happens the file suffers the consequences. On our DEC-2060, using NEWS (5.2(1213)) and NNTP to get netnews from a Pyramid, if the Pyramid goes away unexpectedly, so _may_ your NEWSRC file. It happens fairly often. Therefore, I recommend to our users that they keep a backup copy, which is not exactly easy given the filename (^V^?^V[NEWS^V].NEWSRC). You _really_ want to open the file for read, slurp it up, and close it immediately. Then, when the file is safe, you may parse the text in the buffer at leisure. Engage the user in their chosen dialogue and maintain the state in the buffer. When the time comes, open the file for write, write it all, and close it immediately. Open files are very vulnerable; closed files are much more likely to survive any odd occurrence. If you want a command to update the NEWSRC file at the user's whim, then that should be reasonably easy to add, and its cost would be obvious to the user when they use it, so they could make a rational decision about how often to force an update. It is almost always best to do as little as possible without specific direction to do so, if for no other reason than to obey The Law of Least Surprise. -=- -- Lum Johnson lum@cis.ohio-state.edu lum@osu-20.ircc.ohio-state.edu "You got it kid -- the large print giveth and the small print taketh away." -------