DataMuseum.dk

Presents historical artifacts from the history of:

DKUUG/EUUG Conference tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about DKUUG/EUUG Conference tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download
Index: T v

⟦df264aaa0⟧ TextFile

    Length: 1237 (0x4d5)
    Types: TextFile
    Names: »vrfy.c«

Derivation

└─⟦9ae75bfbd⟧ Bits:30007242 EUUGD3: Starter Kit
    └─⟦f91e15335⟧ »EurOpenD3/news/nntp/nntplink2.0.0.tar.Z« 
        └─⟦2c70c5e6b⟧ 
            └─⟦this⟧ »vrfy.c« 

TextFile

#include "global.h"

#ifdef VERIFYQFILE
vrfy(name)
     char *name;
{
  char tmpfn[64];
  char filen[256];
  register bad = 0;
  FILE *a, *b;
  char *cp;
  
  if ((a = fopen(name, "r")) == NULL) {
    dprintf(stderr, "vrfy: Can't open %s for read: %s\n", name,
	    sys_errlist[errno]);
    return;
  }
  sprintf(tmpfn, "%s.vrfy%d", name, getpid());
  if ((b = fopen(tmpfn, "w")) == NULL) {
    dprintf(stderr, "vrfy: Can't open %s for write: %s\n", tmpfn,
	    sys_errlist[errno]);
    return;
  }
  
  while (fgets(filen,sizeof(filen),a) != NULL) {
    char *cp;
    
    filen[strlen(filen)-1]='\0';
    if (access(filen, 0) == -1) {
      if (strlen(filen) < 10) {
	++bad;
	continue;
      }
      cp = filen;
      while ((cp = index(cp+1, '/')) != NULL) {
	*cp = '\0';
	if (!strncmp(cp+1, "usr/spool/news", 14)) {
	  fprintf(b, "%s\n", filen);
	  fprintf(b, "/%s\n", cp+1);
	  break;
	}
	*cp = '/';
      }
    } else {
      fprintf(b, "%s\n", filen);
    }
  }
  fclose(a);
  fclose(b);
  if (unlink(name) == -1)
    dprintf(stderr, "unlink %s failed (%s)\n", name,
	    sys_errlist[errno]);
  
  if (rename(tmpfn, name) == -1)
    dprintf(stderr, "rename %s %s failed (%s)\n", tmpfn, name,
	    sys_errlist[errno]);
  
}
#endif