1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<html>
3
4<head>
5<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
6<META http-equiv="Content-Style-Type" content="text/css">
7<LINK rel="stylesheet" type="text/css" href="../CSS/revolution.css">
8<title>VFCreateSystemFile*</title>
9</head>
10
11<body>
12
13<h1>VFCreateSystemFile*</h1>
14
15<h2>Syntax</h2>
16<dl><dd><pre><code>
17#include &lt;revolution/vf.h&gt;
18
19typedef s32	VFDevErr;
20
21VFDevErr VFCreateSystemFileNANDFlash( const char* sysFileName, u32 fileSize );
22VFDevErr VFCreateSystemFileRam( void* memory, u32 fileSize );
23</code></pre></dd></dl>
24
25<h2>Arguments</h2>
26<p>
27<TABLE border="1" >
28  <tr>
29<TD valign="top" width="120" bgcolor="#ffffe8"><CODE><STRONG><EM>sysFileName</EM></STRONG></CODE></TD>
30<TD width="520">The file path for the vff file being created. The file name must use 8.3 format.</TD>
31  </tr>
32  <tr>
33<TD valign="top" width="120" bgcolor="#ffffe8"><CODE><STRONG><EM>memory</EM></STRONG></CODE></TD>
34<TD width="520">The RAM address for the vff file being created.</TD>
35  </tr>
36  <tr>
37<TD valign="top" width="120" bgcolor="#ffffe8"><CODE><STRONG><EM>fileSize</EM></STRONG></CODE></TD>
38<TD width="520">The size of the <CODE>.vff</CODE> file being created (specify a size larger than 20KBytes that is a multiple of 32).<br></TD>
39  </tr>
40</TABLE>
41</p>
42
43<h2>Return Values</h2>
44<P>When the <CODE>VFCreateSystemFileNANDFlash</CODE> function was used, one of the following API return values from the NAND library (the <CODE>NAND_RESULT_*</CODE> functions) is returned.</P>
45<pre>
46  <CODE>NANDCreate</CODE>
47  <CODE>NANDOpen</CODE>
48  <CODE>NANDWrite</CODE>
49  <CODE>NandDelete</CODE>
50</pre>
51<P>However, because <CODE>NAND_RESULT_BUSY</CODE> and <CODE>NAND_RESULT_ALLOC_FAILED</CODE> are processed internally in the VF library, they are not returned.</P><P><CODE>NAND_RESULT_OK</CODE> is returned if the function ends normally. For more information, see the NAND Library manual. When the <CODE>VFCreateSystemFileRam</CODE> function is used, 0 (normal termination) is always returned.</P>
52
53<H2>Description</H2>
54<p>
55Creates 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.<br><br> To create a VFF file in NAND memory, use the application to check the amount of available space using the <CODE>NANDCheck</CODE> function.<br>  <br>Currently, when a VFF file is created with the <CODE>VFCreateSystemFileNANDFlash</CODE> function, the file is created such that only its owner has read/write permissions.<br><br>When a created VFF file is used for the first time, be sure to format with the <CODE>VFFormatDrive</CODE> function after calling one of the <CODE>VFMountDriveXXX</CODE> functions.<br><br> Delete the VFF file within the VF library and return an error if this fails while creating the file.<br><br> If the specified VFF file already exists, this function always returns 0 (normal termination). However, if the VFF file format is invalid or corrupted, <CODE>VF_ERR_VFF_FILE_FORMAT</CODE> will be returned during mounting. In this case the VFF file should be deleted and recreated.
56</p>
57
58
59<h2>See Also</h2>
60<p>
61<code><a href="./VFMountDrive.html">VFMountDrive</a></code>, <code><a href="./VFFormatDrive.html">VFFormatDrive</a></code>
62</p>
63
64<H2>Revision History</H2>
65<p>
662009/01/05 Added explanation of NAND library functions to the item relating to return values.  2008/12/25 Revised unnecessary text in descriptions.<br>2007/05/08  Revised the description of Arguments and added descriptions for Return Values.<br> 2006/10/11 Initial version.<br>
67</p>
68
69
70<hr><p>CONFIDENTIAL</p></body>
71</html>
72