nyssa@terminus.UUCP (The Prime Minister) (12/01/88)
Nexpire functions rather simply. It's first task is to parse the command line arguments. There are 8 possible flags, five of which are accompanied by some information. The getopt(3) library call is used to examine these arguments. Next, nexpire will build its internal hash table. The table is designed to store the newsgroup name and the retention time in seconds for that group, as well as bookkeeping information for the active file. The newsgroup name is the key to the table. The table is normally created by a call to pexpire, but the -f flag will circumvent that call. After generating the table, nexpire will read the history file sequentially. If there is no article associated with the message ID on the system, the date is checked against the history retention time to see if the history is still needed. If the article still exists, then it is checked in each cross posted newsgroup against the hash table's retention time. Only when it has expired in all newsgroups is it removed from the system in any news groups. (This can be circumvented by the -x flag, which says get rid of the article in all groups as soon as any group says get rid of it.) When the history file is totally processed, nexpire then updates the active file to show what the most recent and oldest articles in the system for that newsgroup are. Finally, the clean up involves moving the new active and history files into their proper locations, and removing the history lock file. Other flags are: -s Do not catch signals -c List commands to be executed, but do not execute. -v# Give verbose output. -k list Keep these newsgroups. -z list Expire these newsgroups immediately. -E# Retain this much info in the history file. -- James C. Armstrong, Jr nyssa@terminus.UUCP