[comp.sources.bugs] RN 4.3

abc@ncsuvx.ncsu.edu (Alan B. Clegg) (06/10/87)

When a user goes over disk quota while reading news with RN, there is a good
chance that RN will destroy the users $HOME/.newsrc file, leaving it zero 
length.

Any fixes for this one?

-abc
-- 
	   Alan B. Clegg | NCSU Comp Center | abc@ncsuvx.ncsu.edu

pett@cgl.ucsf.edu.UUCP (06/11/87)

In article <952@ncsuvx.ncsu.edu> abc@ncsuvx.ncsu.edu (Alan B. Clegg) writes:
>When a user goes over disk quota while reading news with RN, there is a good
>chance that RN will destroy the users $HOME/.newsrc file, leaving it zero 
>length.

I *wondered* what happened to my .newsrc!  I had to restore mine from tape. Ugh.

jpn@teddy.UUCP (06/15/87)

>This is not an RN problem but a generic UNIX problem.  Any program which
>opens a file for output is subject to leaving a zero length file when the
>user goes over quota.  Either that or vi,ex,ed,emacs,cc (too name a few)
>all have the same identical bug that rn has!!

Sorry, "vi" and "ex" (at least on ULTRIX and SUN unixes) DETECT this
condition, and display an error, rather than silently truncating your
file and exiting.  This gives you the chance to suspend your edit
session, and clean up some files (or increase your quota) and attempt
to write the file again.

All programs should detect this condition, since it is logically equivalent
to the disk-full condition - which really CAN HAPPEN!  Any program that does
not detect this is just lazy, because it should always check the return
values from "write" and "close".  In Rn's case, if the NEW .newsrc cannot
be written, it should leave the OLD .newsrc intact, display an error, and
exit.

phil@amdcad.UUCP (06/16/87)

In article <4103@teddy.UUCP> jpn@teddy.UUCP (John P. Nelson) writes:
>values from "write" and "close".  In Rn's case, if the NEW .newsrc cannot
>be written, it should leave the OLD .newsrc intact, display an error, and
>exit.

This is a bad deal as it will force me to re-read all the articles I
read in that session. How about displaying an error and then asking me
what I want to do next? Then I can ^Z or spawn a subshell to make some
space to write out the .newsrc. 

-- 
Phil Ngai, {ucbvax,decwrl,allegra}!amdcad!phil or amdcad!phil@decwrl.dec.com

levy@ttrdc.UUCP (06/16/87)

In article <1074@rayssd.RAY.COM>, dhb@rayssd.RAY.COM (David Brierley) writes:
< In article <952@ncsuvx.ncsu.edu> abc@ncsuvx.ncsu.edu (Alan B. Clegg) writes:
< >When a user goes over disk quota while reading news with RN, there is a good
< >chance that RN will destroy the users $HOME/.newsrc file, leaving it zero 
< >length.
< >
< >Any fixes for this one?
< 
< This is not an RN problem but a generic UNIX problem.  Any program which
< opens a file for output is subject to leaving a zero length file when the
< user goes over quota.  Either that or vi,ex,ed,emacs,cc (too name a few)
< all have the same identical bug that rn has!!

This kind of problem could be avoided by opening a temp file in the same
directory as the .newsrc file (if possible), writing the new .newsrc data
into it, and if the write was successful unlinking the old .newsrc, linking the
new file to .newsrc, then unlinking the original temporary file name.
It would be an additional "friendly" feature.
-- 
|------------dan levy------------|  Path: ..!{akgua,homxb,ihnp4,ltuxa,mvuxa,
|         an engihacker @        |		vax135}!ttrdc!ttrda!levy
|    at&t data systems division  |  Disclaimer:  try datclaimer.
|--------skokie, illinois--------|