Aittvax.115 net.unix-wizards utzoo!decvax!ittvax!swatt Sun Aug 30 18:17:36 1981 recovering blown-away .nindex files A while back, Mark at ucbvax mentioned that they had lost their .nindex file. Well we just did too -- boy what a pain!. If any of you have run into that problem you might already have a program that does this, but for the rest, here is some insurance. - Alan S. Watt (decvax!ittvax!swatt) :::::::::::::::::: newsrecover.c: :::::::::::::::::: /* Yuck, recover ".nindex" files that got clobbered by * a news malfunction. * * Usage: * newsrecover [-submit] * * -submit argument causes date to be taken from the submission * date of article, file modification time otherwise. */ #include #include #include #include #ifndef NEWSDIR # define NEWSDIR "/usr/spool/news" #endif #ifdef lint # define IGNORE(X) __void__=(int)(X) int __void__; #else # define IGNORE(X) X #endif #define EOS '\0' #define NO 0 #define YES 1 char newsdir[] = NEWSDIR; struct { char fmtid[80]; char ngrp[80]; char contrb[80]; char date[32]; } H; char *index(), *rindex(); int submit = NO; main(argc, argv) char **argv; { long timeret, timenow; register FILE *filef, *dirf; struct dir dirbuf; struct stat sb; if (argc > 1 && strcmp (argv[1], "-submit") == 0) submit = YES; IGNORE (time (&timenow)); if (chdir (newsdir)) fperror ("cannot change directory to %s", newsdir); if ((dirf = fopen (".", "r"))
This Usenet Oldnews Archive article may be copied and distributed freely, provided:

1. There is no money collected for the text(s) of the articles.
2. The following notice remains appended to each copy:

The Usenet Oldnews Archive: Compilation Copyright© 1981, 1996
Bruce Jones, Henry Spencer, David Wiseman.


Goto NEXT article in NET.unix-wizards Newsgroup
Return to NET.unix-wizards index
Return to the Usenet Oldnews Archive index ----------------------------------------------------------------- gopher://quux.org/ conversion by John Goerzen of http://communication.ucsd.edu/A-News/ This Usenet Oldnews Archive article may be copied and distributed freely, provided: 1. There is no money collected for the text(s) of the articles. 2. The following notice remains appended to each copy: The Usenet Oldnews Archive: Compilation Copyright (C) 1981, 1996 Bruce Jones, Henry Spencer, David Wiseman.