# NNS_McsReadFile

## C Specification

      #include <nnsys/mcs.h>

      u32 NNS_McsReadFile(
      NNSMcsFile* pFile,
      void*                       buffer,
      u32         length,
      u32*        pReadBytes);

## Arguments

pFile | Pointer to the file information structure
buffer | Pointer to the buffer. If the read is successful, the loaded content is stored in this buffer.
length | Number of bytes being read.
pReadBytes | Pointer to the variable. If the read is successful, the number of bytes that were actually loaded gets stored in this variable.

## Return Values

Returns `0` if the data is successfully read from the file. A nonzero value is returned if the read process. The return value is one of the following:

## Description

Reads data from a file on a PC.

The return value takes one of the following values.

`NNS_MCS_FILEIO_ERROR_SUCCESS` (0) | The function was successful.
NNS_MCS_FILEIO_ERROR_COMERROR | A communications error occurred.
NNS_MCS_FILEIO_ERROR_NOTCONNECT | Not connected to the mcs server.
NNS_MCS_FILEIO_ERROR_SERVERERROR | A error has occurred due to a file operation on the mcs server side. The error code is a Win32 system error code that can be obtained using the `NNS_McsGetServerErrorCode` function.

## See Also

`NNS_McsOpenFile, NNS_McsWriteFile, NNS_McsCloseFile`

## Revision History

01/24/2005 Added the description regarding the error code.
07/01/2004 Initial version.