#include <stdio.h>
#include "filsys.h"

union {
	short	pdpt[2];
	long	vaxt;
} t;

main(ac, av)
	char **av;
{
	FILE *fp;
	struct filsys fs, *fsp;
	char *ctime();

	if (ac < 2) {
		fprintf(stderr, "usage: cksb filename\n");
		exit(1);
	}
	ac--; av++;
	if ((fp=fopen(*av, "r")) == NULL) {
		perror(*av);
		exit(1);
	}
	(void) fseek(fp, 512, 0);
	if (fread(&fs, sizeof(fs), 1, fp) != 1) {
		perror("read");
		exit(1);
	}

	fsp = &fs;
	printf("isize=%d\n", fsp->isize);
	printf("fsize=%d\n", fsp->fsize);
	printf("nfree=%d\n", fsp->nfree);
	printf("ninode=%d\n", fsp->ninode);
	t.pdpt[0] = fsp->time[1];
	t.pdpt[1] = fsp->time[0];
	printf("time: %s", ctime(&t.vaxt));
}
