home *** CD-ROM | disk | FTP | other *** search
- /* btwrit */
- #include <stdio.h>
- #include <btextern.h>
- int btwrit (filhand, recno)
- int filhand, recno;
- {
- long offset;
- int i;
- char *cp;
-
- /* seek to correct byte in record */
- offset = recno * LBLEN;
- if (( i = fseek (btfilar[filhand].fdesc, offset, 0)) == -1)
- BTSETCOD (filhand, recno, 3); /* bad file seek */
-
- cp = (char *)btfilar[filhand].filbuf;
-
- if (!( i = fwrite (cp, 1, LBLEN, btfilar[filhand].fdesc)))
- BTSETCOD (filhand, recno, 2); /* bad write */
- return (0);
- }
- /* end of btwrit */