]>
diplodocus.org Git - nmh/blob - sbr/fdcompare.c
3 * fdcompare.c -- are two files identical?
12 fdcompare (int fd1
, int fd2
)
14 register int i
, n1
, n2
, resp
;
15 register char *c1
, *c2
;
16 char b1
[BUFSIZ
], b2
[BUFSIZ
];
19 while ((n1
= read (fd1
, b1
, sizeof(b1
))) >= 0
20 && (n2
= read (fd2
, b2
, sizeof(b2
))) >= 0
24 for (i
= n1
< sizeof(b1
) ? n1
: sizeof(b1
); i
--;)
35 lseek (fd1
, (off_t
) 0, SEEK_SET
);
36 lseek (fd2
, (off_t
) 0, SEEK_SET
);