


      WWWWrrrriiiitttteeeeBBBBlllloooocccckkkk((((3333BBBB))))               ((((RRRRiiiiddddggggeeee))))               WWWWrrrriiiitttteeeeBBBBlllloooocccckkkk((((3333BBBB))))



      NNNNAAAAMMMMEEEE
           WriteBlock - write a block of a file

      SSSSYYYYNNNNTTTTAAAAXXXX
           FUNCTION WriteBlock (handle : Link;
                                bufAddr : PageAddress;
                                fileCursor : Integer;
                                length : Integer;
                            var actual : Integer) : Error;

      DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
           _W_r_i_t_e_B_l_o_c_k is used to write a block of data to the file
           specified by hhhhaaaannnnddddlllleeee. The hhhhaaaannnnddddlllleeee is a file link returned from
           a successful Create or Open call, and it represents a file
           that must allow block mode access.

           The block of data from the buffer address in the user
           process data segment specified by bbbbuuuuffffAAAAddddddddrrrr, which must be
           page-aligned, is transferred to the file at the byte
           position specified by ffffiiiilllleeeeCCCCuuuurrrrssssoooorrrr.

           The amount of data to be written is specified in lllleeeennnnggggtttthhhh, and
           the amount actually transferred is returned in aaaaccccttttuuuuaaaallll, which
           can be from 0 to 4096 bytes.

           The file size is increased by any bytes which extend past
           the current end of file.

      SSSSEEEEEEEE AAAALLLLSSSSOOOO
           Create (3B), Open (3B), ReadBlock (3B), ReadChar (3B),
           WriteChar (3B)

      NNNNOOOOTTTTEEEESSSS
           ErBadLink is returned if hhhhaaaannnnddddlllleeee is not a valid open file.

           ErNotAligned is returned if bbbbuuuuffffAAAAddddddddrrrr is not page-aligned,
           that is, an address that is not a multiple of 4096, while
           ErBadBlockLength is returned if lllleeeennnnggggtttthhhh is greater than 4096.

           ErNotWritable is returned if the file was not opened to
           allow writing.

           ErBadFileCursor is returned if an attempt is made to write a
           block beyond the current end of file, which would leave a
           gap in the file.










      Page 1                                                   (9010-E)



