#include "jzdirect.h"
main(argc,argv)
int argc;
char **argv;
{

  char name[50];
  int attr,werror,attrcode,old;
  TDIR wdir;

  if (argc < 3) {
    printf("\nThis small program allows you to change file attributes");
    printf("\nby specific file name or using wildcards.");
    printf("\n- Jack A. Zucker (Jaz) 75766,1336");
    printf("\n\nUSAGE:  jzsetatr <Filename> <file attribute>");
    exit();
  }

  werror = jzfndfst(*++argv,0xFF,&wdir);

  if (werror == 0) {
    attr = atoi(*++argv);
    do {
      old = jzgetatr(wdir.name);
      attrcode = jzsetatr(wdir.name,attr);
      if (attrcode == 0)
	printf("\nChanging attribute of %s from %d to %d",wdir.name,old,attr);
      else
	 printf("\nUnable to change attribute of %s",wdir.name);
      werror = jzfndnxt(&wdir);
    } while (werror == 0);
  }
  else
    printf("\nNo matching Files.");
}

