1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 2<html xmlns="http://www.w3.org/1999/xhtml"> 3<head> 4<meta http-equiv="Content-Type" content="text/html; charset=windows-1252" /> 5<meta http-equiv="Content-Style-Type" content="text/css" /> 6<title>FSResult</title> 7<link rel="stylesheet" href="../css/nitro.css" type="text/css" /> 8</head> 9<body> 10 11<h1>FSResult <img src="../image/NTR.gif"align="middle"><img src="../image/TWL.gif" align="middle"></h1> 12<h2>Definition</h2> 13<pre><code> 14#include <nitro/fs.h> 15 16typedef enum FSResult 17{ 18 FS_RESULT_SUCCESS = 0, 19 FS_RESULT_FAILURE = 1, 20 FS_RESULT_BUSY = 2, 21 FS_RESULT_CANCELED = 3, 22 FS_RESULT_UNSUPPORTED = 4, 23 FS_RESULT_ERROR = 5, 24 FS_RESULT_INVALID_PARAMETER = 6, 25 FS_RESULT_NO_MORE_RESOURCE = 7, 26 FS_RESULT_ALREADY_DONE = 8, 27 FS_RESULT_PERMISSION_DENIED = 9, 28 FS_RESULT_MEDIA_FATAL = 10, 29 FS_RESULT_NO_ENTRY = 11, 30 FS_RESULT_MEDIA_NOTHING = 12, 31 FS_RESULT_MEDIA_UNKNOWN = 13, 32 FS_RESULT_BAD_FORMAT = 14, 33 34 FS_RESULT_PROC_ASYNC = 256, 35 FS_RESULT_PROC_DEFAULT, 36 FS_RESULT_PROC_UNKNOWN, 37 38 FS_RESULT_CANCELLED = FS_RESULT_CANCELED 39} 40FSResult; 41</code></pre> 42 43<h2>Description</h2> 44<p>These enumerator types represent the results of the file system API and the user procedures of the archive.<br />They are defined as follows.</p> 45 46<table> 47<tbody> 48 49<tr><td colspan="2" style="border:solid 1px black;background-color:Transparent">The following values can be returned as results from the FS library functions.</td></tr> 50 51<tr><td>FS_RESULT_SUCCESS</td> 52<td>Indicates success as a result of the function's correct processing.<br />Example: Suppose that <code><a href="file/FS_ReadFile.html">FS_ReadFile</a></code> attempts to read 100 bytes of data, but reaches the end of the file after only reading 50 bytes. This is normal behavior and is recorded as successful.</td> 53</tr> 54 55<tr><td>FS_RESULT_FAILURE</td> 56<td>Indicates failure as a result of the function's correct processing.<br />Example: This indicates a failure as one of the expected return values for the process when you have read to the end using the <code><a href="file/FS_ReadDir.html">FS_ReadDir</a></code> function.</td></tr> 57 58<tr><td>FS_RESULT_BUSY</td> 59<td>Indicates that the current command is busy.<br />Strictly speaking, this is not an error because the operation is incomplete. However, we have included this with the errors for the sake of convenience.</td></tr> 60 61<tr><td>FS_RESULT_CANCELED</td> 62<td>Indicates that the command was canceled.<br /><br />There are two types of cancels: (1) explicit command cancels by the user, and (2) forced cancel when the archive is unloaded.</td></tr> 63 64<tr><td>FS_RESULT_UNSUPPORTED</td> 65<td>Indicates that the archive is not supported by the specified command.<br />This error occurs when the archive that ignores certain commands explicitly returns this as a return value of a user procedure.<br />If this error gets returned unexpectedly, you should double-check for any unique specifications of the archive in question.</td></tr> 66 67<tr><td>FS_RESULT_INVALID_PARAMETER</td> 68<td>Indicates that one of the arguments provided is invalid or outside the allowed range. This mostly occurs with NULL pointers or when an invalid handle is specified.</td></tr> 69 70<tr><td>FS_RESULT_NO_MORE_RESOURCE</td> 71<td>Indicates that certain resources required for the operation turned out to be insufficient internally. The number of handles that can be opened simultaneously, as well as the upper limit for dynamic memory consumed internally, are different for each archive.</td></tr> 72 73<tr><td>FS_RESULT_ALREADY_DONE</td> 74<td>Indicates that the requested operation has already been performed. This will occur if the file specified to <code><a href="directory/FS_CreateFile.html">FS_CreateFile()</a></code> already exists, for example, or if the directory specified to <code><a href="directory/FS_DeleteDirectory.html">FS_DeleteDirectory()</a></code> didn't exist to begin with.</td></tr> 75 76<tr><td>FS_RESULT_PERMISSION_DENIED</td> 77<td>Indicates that the requested process failed due to a problem of access rights.<br />This primarily happens in the following cases: 78<ul> 79<li>An attempt is made to open with write permission a read-only file</li> 80<li>An attempt is made to delete a directory that is not empty</li> 81<li>An attempt is made to open a TWL-exclusive file (as specified by the <a href="../tools/makerom.html#ROMSPEC_TWL"><CODE>Put</CODE> parameter of the <CODE>makerom</CODE> tool</a>) in the NITRO environment</li> 82<li>An SD Card is write-protected</li> 83<li>An attempt is made to open a file that is larger than 2 GB, which is not supported by the FS library</li> 84</ul> 85</td></tr> 86 87<tr><td style="background-color:#FFF0F0;">FS_RESULT_MEDIA_FATAL</td> 88<td style="background-color:#FFF0F0;">Indicates that a fatal device error is detected in writable media such as a <a href="archive_nand_spec.html">NAND archive</a> or an <a href="archive_sdmc_spec.html">SD Card archive</a>. Processing cannot continue. Prompt the user to replace or re-insert the SD card, or, if the error is in system save memory (NAND), to have the system repaired.</td></tr> 89 90<tr><td style="background-color:#FFF0F0;">FS_RESULT_BAD_FORMAT</td> 91<td style="background-color:#FFF0F0;">This will occur if corruption in the file system is detected in writable media such as a <a href="archive_nand_spec.html">NAND archive</a> or an <a href="archive_sdmc_spec.html">SD Card library</a>. Processing cannot continue. Prompt the user to replace or re-insert the SD card, or, if the error is in system save memory (NAND), reformat the archive using the <CODE>NA_FormatTitleArchive</CODE> function.</td></tr> 92 93<tr><td>FS_RESULT_NO_ENTRY</td> 94<td>Indicates that the specified path does not exist. This error will also occur when trying to create a file under a directory that doesn't exist.</td></tr> 95 96<tr><td>FS_RESULT_MEDIA_NOTHING</td> 97<td>The specified archive is located on removable media, and that device was not inserted. Currently, this error is only returned by <a href="archive_sdmc_spec.html">SD Card archives</a>.</td></tr> 98 99<tr><td>FS_RESULT_MEDIA_UNKNOWN</td> 100<td>The specified archive is located on removable media, and an unknown device has been inserted that doesn't have a known file system. Currently, this error is only returned by <a href="archive_sdmc_spec.html">SD Card archives</a>.</td></tr> 101 102<tr><td>FS_RESULT_ERROR</td> 103<td>Indicates that some other detectable error occurred during an operation.</td></tr> 104 105<tr><td colspan="2" style="border:solid 1px black;background-color:Transparent"><br />The following are used only as user procedure return values:</td></tr> 106 107<tr><td>FS_RESULT_PROC_ASYNC</td> 108<td>Return value when the user procedure returns a temporary control for asynchronous processing.<br />When this value is returned, you must notify the read/write callback as well as the process completion using the <code><a href="archive/FS_NotifyArchiveAsyncEnd.html">FS_NotifyArchiveAsyncEnd</a></code> function.</td></tr> 109 110<tr><td>FS_RESULT_PROC_DEFAULT</td> 111<td>The default return value passed to a user procedure. This is the value passed unless a different value/type is called explicitly. The user procedure for the corresponding command will be called the next time as well. If you simply want to hook an existing command, this value is returned every time.</td></tr> 112 113<tr><td>FS_RESULT_PROC_UNKNOWN</td> 114<td>The default return value passed to a user procedure when the procedure call flag to the associated command is canceled. The command will not be called again.</td></tr> 115 116<tr><td>FS_RESULT_SUCCESS</td><td rowspan="10">You must follow the rules described above to determine about the specific archive in question and return from the procedure accordingly.</td></tr> 117 118<tr><td>FS_RESULT_FAILURE</td></tr> 119 120<tr><td>FS_RESULT_UNSUPPORTED</td></tr> 121 122<tr><td>FS_RESULT_INVALID_PARAMETER</td></tr> 123 124<tr><td>FS_RESULT_NO_MORE_RESOURCE</td></tr> 125 126<tr><td>FS_RESULT_ALREADY_DONE</td></tr> 127 128<tr><td>FS_RESULT_PERMISSION_DENIED</td></tr> 129 130<tr><td>FS_RESULT_MEDIA_FATAL</td></tr> 131 132<tr><td>FS_RESULT_NO_ENTRY</td></tr> 133 134<tr><td>FS_RESULT_ERROR</td></tr> 135 136</tbody> 137</table> 138 139<h2>See Also</h2> 140<p><code><a href="fs_archive_type.html">FSArchive</a><BR> <a href="fs_archive_proc_func_type.html">FS_ARCHIVE_PROC_FUNC</a> <br /> <a href="archive/FS_SetArchiveProc.html">FS_SetArchiveProc</a></code></p> 141 142<h2>Revision History</h2> 143<p> 1442009/06/08 Added link to explanation of TWL-exclusive files.<br />2009/02/05 Expanded explanation of FS_RESULT_PERMISSION_DENIED.<br />2008/10/21 Added a detailed description of FS_RESULT_MEDIA_FATAL and FS_RESULT_BAD_FORMAT.<br />2008/07/16 Added conditions for issuing <CODE>FS_RESULT_PERMISSION_DENIED</CODE>. <br />2008/06/25 Added <CODE>FS_RESULT_MEDIA_NOTHING</CODE>, <CODE>FS_RESULT_MEDIA_UNKNOWN</CODE>, and <CODE>FS_RESULT_BAD_FORMAT</CODE>. <br />2008/05/13 Added <CODE>FS_RESULT_NO_ENTRY</CODE>. <br />2008/04/42 Clarified the correspondence between error codes and numerical values.<br />2008/03/12 Added <CODE>FS_RESULT_MEDIA_FATAL</CODE>. <br />2007/09/18 Added a value and its description to the enumerated type. <br />2004/07/12 Added a value and its description to the enumerated type. <br />2004/07/01 Initial version.<br /> 145</p> 146<hr><p>CONFIDENTIAL</p></body> 147</html> 148