home *** CD-ROM | disk | FTP | other *** search
- /* da_append(name, len) opens a file for appending
-
- Copyright (c) 1983 by James F. Gimpel
- Copyright (c) 1983, 1984, 1985 by JMI Software Consultants, Inc.
- */
- #include "acom.h"
-
- FILE da_append(name, len)
- TEXT *name;
- INT len;
- {
- INT n;
- long cpos, lseek();
- char fbuf[10];
-
- if ((n = da_special(name, YES)) < 0)
- n = da_file(name, len);
- if (n >= 0)
- {
- while (read(n, fbuf, 1))
- if ((fbuf[0]-'\0') == 26)
- {
- cpos = lseek(n, 0L, 1);
- lseek(n, (cpos-1), 0);
- break;
- }
- da_autoclos(n);
- }
- return (n);
- }