PUTC,PUTW,FCREAT,FLUSH (III) 6/12/72 PUTC,PUTW,FCREAT,FLUSH (III)





NAME            putc, putw, fcreat, flush  --  buffered output



SYNOPSIS        mov     $filename,r0

                jsr     r5,fcreat; iobuf



                (get byte in r0)

                jsr     r5,putc; iobuf



                (get word in r0)

                jsr     r5,putw; iobuf



                jsr     r5,flush; iobuf



DESCRIPTION     fcreat creates the given file (mode 17) and sets

                up the buffer iobuf (size 518(10) bytes); putc

                and putw write a byte or word respectively onto

                the file; flush forces the contents of the buffer

                to be written, but does not close the file.  The

                format of the buffer is:



                iobuf:  .=.+2           / file descriptor

                        .=.+2           / characters unused in buffer

                        .=.+2           / ptr to next free character

                        .=.+512.        / buffer



                fcreat sets the error bit (c-bit) if the file

                creation failed; none of the other routines re-

                turn error information.



                Before terminating, a program should call flush

                to force out the last of the output.



                The user must supply iobuf, which should begin on

                a word boundary.



                To write a new file using the same buffer, it

                suffices to call flush, close the file, and call

                fcreat again.



FILES           kept in /lib/liba.a



SEE ALSO        creat(II), write(II), getc(III)



DIAGNOSTICS     error bit possible on fcreat call



BUGS            --