Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- CA-Clipper 5.2 . Technical Reference - <b>_fsread()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 _fsRead()
 Read a file
------------------------------------------------------------------------------
 C Prototype

     #include "filesys.api"
     USHORT _fsRead(
                     FHANDLE hFileHandle,
                     BYTEP fpBuff,
                     USHORT uiCount
                   )

 Arguments

     hFileHandle is a valid DOS reference to the file to be read.

     fpBuff is a pointer to an allocated memory buffer.

     uiCount is the number of bytes to be read from the file.

 Returns

     _fsRead() returns the number of bytes read from the file.

 Description

     _fsRead() reads characters from the file specified by hFileHandle into
     the buffer area specified by fpBuff.  It reads from the file starting at
     the current DOS file pointer position, advancing the file pointer by the
     number of bytes read.  If the return value is not equal to the uiCount
     specified, use _fsError() to determine the nature of the read error.

     This function is equivalent to the CA-Clipper FREAD() function.

 Examples

     .  The following code fragment illustrates the use of _fsRead().
        Note that error handling should be performed at each step.  Refer to
        The Error System API Reference chapter of this guide for details on
        communicating with the CA-Clipper Error system:

        #include "filesys.api"

        FHANDLE hFile;
        BYTEP fpBuff[15];

        hFile = _fsOpen( "Foo", FO_READWRITE | FO_EXCLUSIVE );

        // Check for an open error before using the file
        if (! _fsError() )
        {
           // Seek to EOF
           _fsSeek( hFile, 0, FS_END );

           _fsRead( hFile, fpBuff, 15 );

           _fsClose( hFile );
        }

 Files:  Library is CLIPPER.LIB, header file is Filesys.api.


See Also: _fsClose() _fsCreate() _fsError() _fsOpen()

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