NNS_McsSeekFile

Syntax

#include <nnsys/mcs.h>
u32 NNS_McsSeekFile(
        NNSMcsFile* pFile,
        s32         distanceToMove,
        u32         moveMethod,
        u32*        pNewFilePointer);

Arguments

pFile Pointer to the file information structure.
distanceToMove Number of bytes to move the file pointer
moveMethod Starting position from which file pointer will move (See Description for details)
pNewFilePointer Pointer to the variable that receives the new file pointer

Return Values

The function returns 0 if the file pointer was moved successfully; otherwise, a non-zero value is returned. See Description for details on the possible return values.

Description

The file pointer is moved to the specified location. The position of the file pointer after the move is set in the variable indicated by the pointer specified by the pNewFilePointer argument. Set NULL when this value is unnecessary.

The current position of the file pointer can be obtained by setting 0 in the distanceToMove argument and specifying NNS_MCS_FILEIO_SEEK_CURRENT in moveMethod.

The moveMethod argument takes one of the following values.

NNS_MCS_FILEIO_SEEK_BEGIN The start of the file is treated as the starting point.
NNS_MCS_FILEIO_SEEK_CURRENT The current position of the file pointer is treated as the starting point.
NNS_MCS_FILEIO_SEEK_END The end of the file is treated as the starting point.

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

Revision History

2005/02/03 Initial version.


CONFIDENTIAL