Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Turbo C - <b>randbwr() random block write</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
randbwr()                Random Block Write

 #include   <dos.h>

 int         randbwr(fcbptr,reccnt);
 struct fcb  *fcbptr;                    Pointer to structure
 int         reccnt;                     Number of records to be written

    randbwr() uses DOS system call 0x28 to write 'reccnt' number of
    records using the open FCB pointed to by 'fcbptr'.  The records are
    written into memory at the current disk transfer address.  They are
    written from the disk record indicated in the 'random record' field
    of the FCB. If 'reccnt' is 0, the file is truncated to the value in
    the 'random record' field. The 'random record' field will be advanced
    by the number of records actually written and thus gives the total
    number of records read.

    Returns:    The following values are returned, based on the result of
                randbwr():

                    0    All records are written
                    1    End-of-file is reached and the last record
                              written is complete.
                    2    Writing records would have wrapped around
                              address 0xFFFF (as many records as possible
                              are written).
                    3    End-of-file is reached with the last record
                              incomplete.

                randbwr() returns 1 if no records are written because
                there is not enough disk space.

See Also: randbrd()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson