1 /* $NetBSD: cvt.c,v 1.2 1997/06/17 18:56:10 christos Exp $ */
4 * Quick hack to convert old binary sup when.collection files into
5 * the new ascii format.
13 main(int argc
, char **argv
)
20 (void) fprintf(stderr
, "Usage: %s <filename>\n", argv
[0]);
24 if ((fd
= open(argv
[1], O_RDWR
)) == -1) {
29 if (read(fd
, &b
, sizeof(b
)) != sizeof(b
)) {
34 if (lseek(fd
, 0, SEEK_SET
) == -1) {
41 if ((fp
= fopen(argv
[1], "w")) == NULL
) {
46 if (fprintf(fp
, "%ld\n", b
) < 0) {
50 if (fclose(fp
) != 0) {