Thread View: news.software.readers
4 messages
4 total messages
Started by Peter Johansson
Sun, 13 Feb 1994 00:06
Manually updating .newsrc (rn/trn)
Author: Peter Johansson
Date: Sun, 13 Feb 1994 00:06
Date: Sun, 13 Feb 1994 00:06
24 lines
1547 bytes
1547 bytes
What are the policies for manually updating ones .newsrc? I've been editing it as long as I've been reading news (4+ years) and I've never had a problem doing so. However, I am in the process of writing a program to automatically "read" articles and then mark them as read. What I would like to do is read in my .newsrc, munge it as necessary, and then write it out. Is there anything I should be aware of? Obviously, I will want some kind of locking to make sure I don't have two processes updating my .newsrc at the same time. Further, does anyone have a library to do this? I just looked through the rn/trn source and decided that it would be easier/quicker to write my own functions than to hack the trn source. Any suggestions or comments? Feel free to e-mail or post. I don't usually read this group, but I'll follow this thread for the next few days. Peter Johansson peter@cs.umbc.edu
Re: Manually updating .newsrc (rn/trn)
Author: David Charlap
Date: Thu, 17 Feb 1994 00:02
Date: Thu, 17 Feb 1994 00:02
33 lines
2360 bytes
2360 bytes
Peter Johansson <peter@cs.umbc.edu> wrote: > >However, I am in the process of writing a program to automatically >"read" articles and then mark them as read. What I would like to do >is read in my .newsrc, munge it as necessary, and then write it out. Look at the "getactive" program. (It's wherever trn's lib directory is). This program will get status information about all active newsgroups and write it to a file. You can then parse this as you wish. I think the newsetup program uses just this method to create your initial .newsrc file. >Is there anything I should be aware of? Obviously, I will want some >kind of locking to make sure I don't have two processes updating my >.newsrc at the same time. rn and trn use the file ~/.rnlock to handle this. If the file exists, then some news-reading process is active. The file contains the pid of the process that has locked the news files. You should check to see if this process is still running, and if it is get out. If the process isn't running, then you should issue a warning and then trash the lock file. At least that's what seems to be a good idea to do. I don't know what trn actually does. If your system can implement hard (not advisory) file locks, then it might just be easier to lock the file and do what you want to it. You won't be able to get a hard lock if some other process has it open. -- +----------------------+------------------------------------------------------+ | David Charlap | The contents of this message are not the opinions of | | Visix Software, Inc. | Visix Software, or of anyone besides myself. | | david@visix.com +------------------------------------------------------+
Re: Manually updating .newsrc (rn/trn)
Author: Larry W. Virden
Date: Fri, 18 Feb 1994 19:23
Date: Fri, 18 Feb 1994 19:23
11 lines
1351 bytes
1351 bytes
Of course one must be aware that using a simple pid locking file should only be used to report to the user why the tool cannot run - if one happens to run trn/rn/etc. in a window open to one cpu and a cron, etc. runs on another cpu (via window, rsh, etc.) the pid will be either missing or worse be assigned to something other than trn. -- :s Great net resources sought... :s Larry W. Virden INET: lvirden@cas.org :s Personal: 674 Falls Place, Reynoldsburg, OH 43068-1614 The task of an educator should be to irrigate the desert not clear the forest.
Re: Manually updating .newsrc (rn/trn)
Author: Pope Clifton
Date: Wed, 23 Feb 1994 23:21
Date: Wed, 23 Feb 1994 23:21
29 lines
2057 bytes
2057 bytes
Peter Johansson (peter@cs.umbc.edu) wrote: : However, I am in the process of writing a program to automatically : "read" articles and then mark them as read. What I would like to do : is read in my .newsrc, munge it as necessary, and then write it out. .. : Further, does anyone have a library to do this? I just looked through : the rn/trn source and decided that it would be easier/quicker to write : my own functions than to hack the trn source. : Any suggestions or comments? Feel free to e-mail or post. I don't : usually read this group, but I'll follow this thread for the next few : days. Could I make a request that you consider the good deed of writing it as a library? I've been thinking that the cause of good newsreading tools would be greatly advanced if people would start gradually composing some libraries of code to do things like process the .newsrc, maintain and chase lists of xrefs, score or kill articles, etc. That way everyone wouldn't keep reinventing the same code in incompatible forms. I would undertake to keep any such libraries available at an ftp-able site. -- Clifton -- cliftonr@netcom.com Clifton Royston, Pope of the CotSG in Paradise "I never claimed to be Sartre . Sartre gives me a headache." - Andrew Beckwith
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads