struct secMapRec {
	char	shortName[12];
	char	longName[50];
	char	filler1[2];
	char	fillnull;
	char	filler2[3];
	char	active;
	char	filler3[3];
	};

main(argc, argv)
int	argc;
char	*argv[];
{
register int		ifd, ofd, i;
char			packed[12 + 50 + 1 + 1];
struct secMapRec	unpacked;
register char		*from, *to;

if (argc != 3) {
	printf("Usage: %s input_file output_file\n", argv[0]);
	printf("       Use krd to get the input file and kwr to install the output file.\n");
	exit(1);
	}
if ((ifd = open(argv[1], 0)) < 0) {
	perror(argv[1]);
	exit(2);
	}
if ((ofd = creat(argv[2], 0666)) < 0) {
	perror(argv[2]);
	(void)close(ifd);
	exit(3);
	}
while (read(ifd, packed, sizeof packed) == sizeof packed) {
	from = (char *)&packed[0];
	to = (char *)&unpacked;
	for (i = 0; i < 12; i++)
		*to++ = *from++;	/* shortName */
	for (i = 0; i < 50; i++)
		*to++ = *from++;	/* longName */
	*to++ = '\0'; *to++ = '\0';
	*to++ = *from++; *to++ = '\0'; *to++ = '\0'; *to++ = '\0';	/* fillnull */
	*to++ = *from++; *to++ = '\0'; *to++ = '\0'; *to++ = '\0';	/* active */
	printf("short name: %s\n", unpacked.shortName);
	printf("long name : %s\n", unpacked.longName);
	printf("fill null : %u\n", unpacked.fillnull);
	printf("active    : %c\n", unpacked.active);
	(void)write(ofd, (char *)&unpacked, sizeof unpacked);
	}
(void)close(ifd);
(void)close(ofd);
}
