VFCreateSystemFile*

Syntax


#include <revolution/vf.h>

typedef s32	VFDevErr;

VFDevErr VFCreateSystemFileNANDFlash( const char* sysFileName, u32 fileSize );
VFDevErr VFCreateSystemFileRam( void* memory, u32 fileSize );

Arguments

sysFileName The file path for the vff file being created. The file name must use 8.3 format.
memory The RAM address for the vff file being created.
fileSize The size of the .vff file being created (specify a size larger than 20KBytes that is a multiple of 32).

Return Values

When the VFCreateSystemFileNANDFlash function was used, one of the following API return values from the NAND library (the NAND_RESULT_* functions) is returned.

  NANDCreate
  NANDOpen
  NANDWrite
  NandDelete

However, because NAND_RESULT_BUSY and NAND_RESULT_ALLOC_FAILED are processed internally in the VF library, they are not returned.

NAND_RESULT_OK is returned if the function ends normally. For more information, see the NAND Library manual. When the VFCreateSystemFileRam function is used, 0 (normal termination) is always returned.

Description

Creates a VFF file (Virtual File system file) on each device. Currently, if an invalid directory is found in the path, the target directory is not created, and an error is returned.

To create a VFF file in NAND memory, use the application to check the amount of available space using the NANDCheck function.

Currently, when a VFF file is created with the VFCreateSystemFileNANDFlash function, the file is created such that only its owner has read/write permissions.

When a created VFF file is used for the first time, be sure to format with the VFFormatDrive function after calling one of the VFMountDriveXXX functions.

Delete the VFF file within the VF library and return an error if this fails while creating the file.

If the specified VFF file already exists, this function always returns 0 (normal termination). However, if the VFF file format is invalid or corrupted, VF_ERR_VFF_FILE_FORMAT will be returned during mounting. In this case the VFF file should be deleted and recreated.

See Also

VFMountDrive, VFFormatDrive

Revision History

2009/01/05 Added explanation of NAND library functions to the item relating to return values. 2008/12/25 Revised unnecessary text in descriptions.
2007/05/08 Revised the description of Arguments and added descriptions for Return Values.
2006/10/11 Initial version.


CONFIDENTIAL