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>_write() write data to a file</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
_write()                 Write Data to a File

 #include   <io.h>

 int        _write(handle,buf,nbyte);
 int        handle;                      Handle associated with file
 void       *buf;                        Buffer
 int        nbyte;                       Number of bytes to be written

    _write() writes 'nbytes' bytes from buffer 'buf' to the file
    associated with 'handle'.  'handle' is a file handle obtained from a
    creat(), open(), dup() dup2(), or fcntl() call.

    Writing always proceeds from the current file pointer.  For devices,
    bytes are directly sent to the device.
            
     Return:    The number of bytes written.  On error, -1 is returned
                and 'errno' is set to one of the following:

                    EACCES         Permission denied
                    EBADF          Bad file number

                If the number of bytes actually written is less than that
                requested, the condition should be considered an error.
                The disk is probably full.

      Notes:    _write() does not do a (LF) to (CR-LF) translation
                because all of its files are binary.

See Also: write()

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