1<?xml version="1.0" encoding="utf-8"?>
2<html xml:lang="en-US" lang="en-US">
3<head>
4    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5    <meta http-equiv="Content-Style-Type" content="text/css" />
6    <link rel="stylesheet" href="../../../css/page.css" type="text/css" />
7<title>File System: Error Handling</title>
8</head>
9<body>
10<h1>File System: Error Handling</h1>
11
12<h2>Table of Contents</h2>
13    <ul>
14<li><a href="#Summary">Overview</a></li>
15      <ul>
16<li><a href="#Summary_Result">Result Handling</a></li>
17<li><a href="#Summary_Error">Errors That Must Not Be Allowed to Occur in Retail Products</a></li>
18<li><a href="#Summary_Api">Functions for File and Directory Operations</a></li>
19<li><a href="#Summary_FatalError">Handling Fatal Errors</a></li>
20      </ul>
21<li><a href="#Mounting">Handling Mount Errors</a></li>
22      <ul>
23<li><a href="#Mounting_RomArchive">ROM Archives</a></li>
24<li><a href="#Mounting_SaveDataArchive">Save Data Archives</a></li>
25<li><a href="#Mounting_ExtSaveDataArchive">Expanded Save Data Archives</a></li>
26<li><a href="#Mounting_SdmcWriteOnlyArchive">Write-only SDMC Archives</a></li>
27      </ul>
28<li><a href="#FileAndDirectory">Handling Errors During File and Directory Operations</a></li>
29      <ul>
30<li><a href="#FileAndDirectory_RomArchive">ROM Archives</a></li>
31<li><a href="#FileAndDirectory_SaveDataArchive">Save Data Archives</a></li>
32<li><a href="#FileAndDirectory_ExtSaveDataArchive">Expanded Save Data Archives</a></li>
33<li><a href="#FileAndDirectory_SdmcWriteOnlyArchive">Write-only SDMC Save Data Archives</a></li>
34      </ul>
35<li><a href="#History">Revision History</a></li>
36    </ul>
37
38<a name="Summary"><h2>Overview</h2></a>
39    <div class="section">
40This page describes error handling for the file system.
41
42<a name="Summary_Result"><h3>Result Handling</h3></a>
43      <div class="section">
44FS functions return many different types of <CODE>Result</CODE> values. These are handled by the following mechanism rather than one value at a time. The following example shows how to handle all errors belonging to the <CODE><a href="../../../nn/fs/ResultNotFound/Overview.html">ResultNotFound</a></CODE> category. <code><pre>
45if(result &lt;= nn::fs::ResultNotFound())
46{
47    // This can catch nn::fs::ResultMediaNotFound as well.
48}
49</pre></code>The <CODE>Result</CODE> objects returned by <CODE>fs</CODE> functions are forbidden from using the arithmetic operators <CODE>==</CODE> or <CODE>!=</CODE>. Using these causes a build error. Also note that the following two examples are equivalent. <code><pre>
50if(nn::fs::ResultNotFound::Includes(result))
51{
52    ...
53}
54</pre></code> <code><pre>
55if(nn::fs::ResultNotFound() &gt;= result)
56{
57    ...
58}
59</pre></code>
60<p><font color="red">Do not directly handle any <CODE>Result</CODE> values that are not mentioned in the Function Reference Manual.</font></p>
61      </div>
62
63<a name="Summary_Error"><h3>Errors That Must Not Be Allowed to Occur in Retail Products</h3></a>
64      <div class="section">
65The following <CODE>Result</CODE> values indicate errors that are caused by application bugs and other such problems. You must fix your program so that these do not occur in retail products.
66        <ul>
67<li><a href="../../../nn/fs/ResultOutOfResource/Overview.html"><CODE>ResultOutOfResource</CODE></a></li>
68<li><a href="../../../nn/fs/ResultAccessDenied/Overview.html"><CODE>ResultAccessDenied</CODE></a></li>
69<li><a href="../../../nn/fs/ResultInvalidArgument/Overview.html"><CODE>ResultInvalidArgument</CODE></a></li>
70<li><a href="../../../nn/fs/ResultNotInitialized/Overview.html"><CODE>ResultNotInitialized</CODE></a></li>
71<li><a href="../../../nn/fs/ResultAlreadyInitialized/Overview.html"><CODE>ResultAlreadyInitialized</CODE></a></li>
72<li><a href="../../../nn/fs/ResultUnsupportedOperation/Overview.html"><CODE>ResultUnsupportedOperation</CODE></a></li>
73        </ul>
74The <CODE>Result</CODE> values listed above may be caused by user operations or it may be impossible to get rid of them entirely during development. You must handle errors that can be caused by the user. Some functions may also specify errors that must not occur in retail products, even though the corresponding <CODE>Result</CODE> values are not among those listed above. For more information, see the documentation for each of these functions in the Function Reference Manual.
75      </div>
76
77<a name="Summary_Api"><h3>Functions for File and Directory Operations</h3></a>
78      <div class="section">
79There are two types of functions used to perform file and directory operations: <CODE>Try</CODE> functions (which have the prefix <CODE>Try</CODE> added to the function name), and non-<CODE>Try</CODE> functions (which do not contain this prefix). <CODE>Try</CODE> functions return a <CODE>Result</CODE> as the return value, unless an fatal internal error occurs. Instead of returning <CODE>Results</CODE>, non-<CODE>Try</CODE> functions are implemented to display a fatal error screen whenever an internal error returns, regardless of whether the error is fatal. Control does not return from the function in this case.<br /><br />Internal errors never occur for ROM archives because of their characteristics. For ROM archives, implementation omissions in error handling can be avoided by using the non-<CODE>Try</CODE> functions. (During development, make sure to eliminate situations in which an error could occur because of an attempt to open a nonexistent file.)<br /> <br />For archives other than ROM archives, you must always check for errors that can result from the user's operations. One typical example is removal of the Game Card by the user, which can lead to corrupted files. As a result, <CODE>Try</CODE> functions should always be used for error handling. Do not use non-<CODE>Try</CODE> functions because they can easily jump to fatal error screens as a result of user operations.
80      </div>
81
82<a name="Summary_FatalError"><h3>Handling Fatal Errors</h3></a>
83      <div class="section">
84You are allowed to use the following macro to jump to the fatal error screen when a file system API function returns an error that you believe to be fatal, or there is a system issue that your application cannot handle.<BR>However, you should only call this macro in the locations shown in the examples below, in order to avoid jumping to the fatal error screen unnecessarily.<BR>
85<pre>
86NN_ERR_THROW_FATAL_ALL(result);
87</pre>
88See the <a href="../../../introduction/ErrorHandling.html">Error Handling</a> page for details about this macro.
89      </div>
90    </div>
91
92<a name="Mounting"><h2>Handling Mount Errors</h2></a>
93    <div class="section">
94The following simplified C++ code provides guidelines for handling mount errors.
95
96<a name="Mounting_RomArchive"><h3>ROM Archives</h3></a>
97      <div class="section">
98<code><pre>
99// An error will cause an internal jump to the fatal error screen.
100// The application does not need to perform error handling.
101// NOTE: When developing an application, confirm that you are passing enough working memory as an argument.
102//       Also check your Omakefile and RSF file settings to determine whether a ROMFS is created at build time.
103nn::fs::MountRom();
104</pre></code>
105      </div>
106
107<a name="Mounting_SaveDataArchive"><h3>Save Data Archives</h3></a>
108      <div class="section">
109<code><pre>
110nn::Result result = nn::fs::MountSaveData();
111
112if(result.IsFailure())
113{
114    if(result &lt;= nn::fs::ResultNotFormatted())
115    {
116        // Formatting required.
117        // CAUSE: Unformatted save data region.
118        // NOTE: You must always format a save data region before mounting it for the first time.
119        result = nn::fs::FormatSaveData();
120    }
121    else if(result &lt;= nn::fs::ResultBadFormat())
122    {
123        // Formatting required.
124        // CAUSE: Invalid file format.
125        result = nn::fs::FormatSaveData();
126    }
127    else if(result &lt;= nn::fs::ResultVerificationFailed())
128    {
129        // Formatting required.
130        // CAUSE: Corrupted or tampered-with save data.
131        // NOTE: This state is never the result of user operations when there is automatic redundancy.
132        //       This error may be caused by user operations (such as removing a card or turning off the system while data is being written) when there is no automatic redundancy.
133        result = nn::fs::FormatSaveData();
134    }
135    else if(result &lt;= nn::fs::ResultOperationDenied())
136    {
137        // As of CTR-SDK 2.1, this error is handled by the system. Treat it as an unexpected error.
138    }
139    else
140    {
141        // Unexpected error if other than the above
142        NN_ERR_THROW_FATAL_ALL(result);
143    }
144
145    // Troubleshooting after formatting
146    if(result.IsFailure())
147    {
148        // Here, the act of formatting save data never fails.
149        // NOTE: When developing your application, confirm that the maxFiles and maxDirectories arguments are not too big.
150        //       Also confirm that the content of the RSF file is correct.
151        // NOTE: Do not format the region while it is mounted, or access save data from another thread during formatting.
152        NN_ERR_THROW_FATAL_ALL(result);
153    }
154    else
155    {
156        // Remount
157        result = nn::fs::MountSaveData();
158        if(result.IsFailure())
159        {
160            // The same as when making the first call.
161            // NOTE: Do not format the region while it is mounted, or access save data from another thread during formatting.
162        }
163    }
164}
165</pre></code>
166      </div>
167
168<a name="Mounting_ExtSaveDataArchive"><h3>Expanded Save Data Archives</h3></a>
169      <div class="section">
170<code><pre>
171nn::Result result = nn::fs::MountExtSaveData();
172
173if(result.IsFailure())
174{
175    if(result &lt;= nn::fs::ResultNotFound())
176    {
177        if(result &lt;= nn::fs::ResultMediaNotFound())
178        {
179            // An SD Card has not been inserted.
180            // Note: This error is also returned if the SD Card is damaged or if some medium other than an SD Card is inserted.
181            //        In such cases, an insertion event registered by <CODE>RegisterSdmcInsertedEvent</CODE> is signaled.
182        }
183        else
184        {
185            // The specified expanded save data does not exist and must be created.
186            // NOTE: Confirm that the ID you specified is correct when developing your application.
187            result = nn::fs::CreateExtSaveData();
188        }
189    }
190    else if(result &lt;= nn::fs::ResultNotFormatted())
191    {
192        // You must recreate the expanded save data.
193        // CAUSE: Failed to create expanded save data.
194        result = nn::fs::DeleteExtSaveData();
195        if(result.IsSuccess())
196        {
197            result = nn::fs::CreateExtSaveData();
198        }
199    }
200    else if(result &lt;= nn::fs::ResultBadFormat())
201    {
202        // You must format the SD Card.
203    }
204    else if(result &lt;= nn::fs::ResultVerificationFailed())
205    {
206        // You must recreate the expanded save data.
207        // CAUSE: The save data has been corrupted or tampered with.
208        result = nn::fs::DeleteExtSaveData();
209        if(result.IsSuccess())
210        {
211            result = nn::fs::CreateExtSaveData();
212        }
213    }
214    else if(result &lt;= nn::fs::ResultOperationDenied())
215    {
216        if(result &lt;= nn::fs::ResultWriteProtected())
217        {
218            // The SD Card is write-protected.
219            // NOTE: This occurs if the data recovery sequence is run during a mount operation.
220        }
221        else if(result &lt;= nn::fs::ResultMediaAccessError())
222        {
223            // This error is only returned when the cause is hardware-related, such as a loose connection.
224            // In such cases, recovery may be possible by re-inserting the SD Card, restarting the system, or some other action.
225        }
226        else
227        {
228            // The file or directory on the SD card may be read-only.
229            // NOTE: This occurs if the data recovery sequence is run during a mount operation.
230        }
231    }
232    else
233    {
234        // Unexpected error if other than the above. Failed to recognize this expanded save data or SD Card.
235        // Do not call &quot;NN_ERR_THROW_FATAL&quot; macros.
236    }
237
238    // Troubleshooting after data has been created.
239    if(result.IsFailure())
240    {
241        if(result &lt;= nn::fs::ResultNotEnoughSpace())
242        {
243            // The SD Card does not have the necessary free space.
244        }
245        else if(result &lt;= nn::fs::ResultNotFormatted())
246        {
247            // An error has occurred, interrupting the process of data creation.
248        }
249        else if(result &lt;= nn::fs::ResultOperationDenied())
250        {
251            if(result &lt;= nn::fs::ResultWriteProtected())
252            {
253                // The SD Card is write-protected.
254            }
255            else if(result &lt;= nn::fs::ResultMediaAccessError())
256            {
257                // This error is only returned when the cause is hardware related, such as a poor connection.
258                //       In such cases, recovery may be possible by retrying, re-inserting the Game Card, restarting the system, or some other action.
259            }
260            else
261            {
262                // The directory on the SD card may be read-only.
263                // NOTE: This occurs if the data recovery sequence is run during a mount operation.
264            }
265        }
266        else
267        {
268            // Unexpected error if other than the above
269            // Failed to recognize this expanded save data or SD Card. Do not jump to the fatal error screen.
270            // NOTE: When developing your application, confirm that valid values are passed to iconData and iconDataSize.
271        }
272    }
273    else
274    {
275        // Remount
276        result = nn::fs::MountExtSaveData();
277        if(result.IsFailure())
278        {
279            // The same as when making the first call.
280            // (Supplement) As long as the SD Card is not removed, mount operations carried out immediately after the data is created will never fail.
281        }
282    }
283}
284</pre></code>
285      </div>
286
287<a name="Mounting_SdmcWriteOnlyArchive"><h3>Write-only SDMC Archives</h3></a>
288      <div class="section">
289<code><pre>
290nn::Result result = nn::fs::MountSdmcWriteOnly();
291
292if(result.IsFailure())
293{
294    if(result &lt;= nn::fs::ResultMediaNotFound())
295    {
296        // An SD Card has not been inserted.
297        // NOTE: This error is also returned if the SD Card is damaged or if some medium other than an SD Card is inserted.
298        //        In such cases, an insertion event registered by <CODE>RegisterSdmcInsertedEvent</CODE> is signaled.
299    }
300    else if(result &lt;= nn::fs::ResultBadFormat())
301    {
302        // You must format the SD Card.
303    }
304    else if(result &lt;= nn::fs::ResultOperationDenied())
305    {
306        if(result &lt;= nn::fs::ResultWriteProtected())
307        {
308            // This error will not be returned when mounted. Check separately by calling the <a href="../../../nn/fs/IsSdmcWritable.html">nn::fs::IsSdmcWritable</a> function.
309        }
310        else if(result &lt;= nn::fs::ResultMediaAccessError())
311        {
312            // This error is only returned when the cause is hardware related, such as a poor connection.
313            // In such cases, recovery may be possible by re-inserting the SD Card, restarting the system, or some other action.
314        }
315        else
316        {
317            // Unexpected error if other than the above
318            // Failed to recognize this SD Card. Do not jump to the fatal error screen.
319        }
320    }
321    else
322    {
323        // Unexpected error if other than the above
324        // Failed to recognize this SD Card. Do not jump to the fatal error screen.
325    }
326}
327</pre></code>
328      </div>
329    </div>
330
331<a name="FileAndDirectory"><h2>Handling Errors During File and Directory Operations</h2></a>
332    <div class="section">
333The following simplified C++ code provides a guideline for handling errors during file and directory operations.<br /><br /><br /> There are two types of functions used to perform file and directory operations: <CODE>Try</CODE> functions (which have the prefix <CODE>Try</CODE> added to the function name), and non-<CODE>Try</CODE> functions (which do not contain this prefix). For details, see <a href="#Summary_Api">Functions for File and Directory Operations</a>.
334
335<a name="FileAndDirectory_RomArchive"><h3>ROM Archives</h3></a>
336      <div class="section">
337<code><pre>
338// Because errors are handled internally by non-<CODE>Try</CODE> functions, you do not need to receive <CODE>Result</CODE> values.
339nn::fs::XXX();
340</pre></code>
341      </div>
342
343<a name="FileAndDirectory_SaveDataArchive"><h3>Save Data Archives</h3></a>
344      <div class="section">
345<code><pre>
346// We need to use Try functions with save data archive.
347result = nn::fs::TryXXX();
348
349if(result.IsFailure())
350{
351    if(result &lt;= nn::fs::ResultNotFound())
352    {
353        // The specified path does not exist.
354        // NOTE: This error is returned when creating a file or directory only if the problem involves an incorrect archive name.
355        //       You do not need to handle this if, by design, it does not occur.
356    }
357    else if(result &lt;= nn::fs::ResultAlreadyExists())
358    {
359        // The specified path already exists.
360        // NOTE: This error is not returned when files and directories are deleted.
361        //       You do not need to handle this if, by design, it does not occur.
362    }
363    else if(result &lt;= nn::fs::ResultVerificationFailed())
364    {
365        // You must delete and recreate this file or directory.
366        // CAUSE: The save data has been corrupted or tampered with.
367        // NOTE: This state will never be caused by user operations (such as removing a card or turning off the system while data is being written) when there is automatic redundancy.
368        //       This error occurs even by user operations when there is no automatic redundancy.
369        //       If this is not resolved, you must format the save data.
370        // NOTE: This error is returned when reading a region that has never been written to.
371        // Be careful after executing the functions <CODE>nn::fs::TryCreateFile</CODE> and <CODE>nn::fs::FileStream::TrySetSize</CODE>.
372    }
373    else if(result &lt;= nn::fs::ResultOperationDenied())
374    {
375        if(result &lt;= nn::fs::ResultMediaAccessError())
376        {
377            // As of CTR-SDK 2.1, this error is handled by the system. Treat it as an unexpected error.
378            NN_ERR_THROW_FATAL_ALL(result);
379        }
380        else
381        {
382            // Access was denied for some reason.
383            // EXAMPLE: You attempted to delete a file that was open elsewhere.
384            //           You attempted to move a file or directory so that it would span archives.
385            //           You attempted to delete the root directory.
386            // NOTE: You do not need handling for the above situations if, by design, they will not occur.
387        }
388    }
389    else if(result &lt;= nn::fs::ResultNotEnoughSpace())
390    {
391        // There is no available space in the archive or on the storage media.
392        // NOTE: This error may occur when creating a file or directory, or changing the file size.
393        //       If this error occurs when you create a file, delete the file because it might be corrupted.
394        //       If this error occurs when you change the size of a file, the file may have grown to the maximum possible size.
395    }
396    else
397    {
398        // Unexpected error if other than the above
399        NN_ERR_THROW_FATAL_ALL(result);
400    }
401}
402</pre></code>
403      </div>
404
405<a name="FileAndDirectory_ExtSaveDataArchive"><h3>Expanded Save Data Archives</h3></a>
406      <div class="section">
407<code><pre>
408result = nn::fs::TryXXX();
409
410if(result.IsFailure())
411{
412    if(result &lt;= nn::fs::ResultNotFound())
413    {
414        if(result &lt;= nn::fs::ResultMediaNotFound())
415        {
416            // An SD Card has not been inserted.
417            // Note: This error is also returned if the SD Card is damaged or if some medium other than an SD Card is inserted.
418            //        In such cases, an insertion event registered by <CODE>RegisterSdmcInsertedEvent</CODE> is signaled.
419        }
420        else
421        {
422            // The specified path does not exist.
423            // NOTE: If this error is returned when opening the file, it may have been deleted from the SD Card using a PC or the like.
424            // NOTE: Expanded save data can also be accessed from other applications,
425            // so handling is not required for this error.
426        }
427    }
428    else if(result &lt;= nn::fs::ResultAlreadyExists())
429    {
430        // The specified path already exists.
431        // NOTE: This error is not returned when directories are deleted.
432        //        If this error is returned when deleting the file, it may have been deleted from the SD Card using a PC or the like.
433        // NOTE: Expanded save data can also be accessed from other applications,
434        // so handling is required for this error.
435    }
436    else if(result &lt;= nn::fs::ResultVerificationFailed())
437    {
438        // You must delete and recreate this file or directory.
439        // CAUSE: The expanded save data has been corrupted or tampered with.
440        // NOTE: If this is not resolved, you need to recreate the expanded save data.
441        // NOTE: This error is returned when reading a region that has never been written to.
442        // Be careful after executing the functions <CODE>nn::fs::TryCreateFile</CODE> and <CODE>nn::fs::FileStream::TrySetSize</CODE>.
443    }
444    else if(result &lt;= nn::fs::ResultArchiveInvalidated())
445    {
446        // You must remount the archive.
447        // CAUSE: The SD Card was removed, making the archive invalid.
448        // NOTE: Close all open files, call the nn::fs::Unmount function, and then remount the archive.
449    }
450    else if(result &lt;= nn::fs::ResultOperationDenied())
451    {
452        if(result &lt;= nn::fs::ResultWriteProtected())
453        {
454            // The SD Card is write-locked.
455            // NOTE: This error occurs when you write to an SD Card. This does not occur when you simply open a file.
456        }
457        else if(result &lt;= nn::fs::ResultMediaAccessError())
458        {
459            // This error is only returned when the cause is hardware related, such as a poor connection.
460            // In such cases, recovery may be possible by re-inserting the SD Card, restarting the system, or some other action.
461        }
462        else
463        {
464            // Access was denied for some reason other than those above.
465            // EXAMPLES: You attempted to write to a file that is read-only.
466            //           You attempted to delete a file that was open elsewhere.
467            //           You attempted to move a file or directory so that it would span archives.
468            //           You attempted to delete the root directory.
469            // (Note) Because the content of expanded save data can be modified even by other applications (depending on operations),
470            // or a user may have spoofed data on the SD card using a PC, this error must always be handled
471        }
472    }
473    else if(result &lt;= nn::fs::ResultNotEnoughSpace())
474    {
475        // There is no available space in the archive or on the storage media.
476        // NOTE: This error may occur when creating a file or directory, or changing the file size.
477        //       If this error occurs when you create a file, delete the file because it might be corrupted.
478        //       If this error occurs when you change the size of a file, the file may have grown to the maximum possible size.
479    }
480    else
481    {
482        // Unexpected error if other than the above
483        // Failed to access this expanded save data or SD Card. Do not jump to the fatal error screen.
484    }
485}
486</pre></code>
487      </div>
488
489<a name="FileAndDirectory_SdmcWriteOnlyArchive"><h3>Write-only SDMC Archives</h3></a>
490      <div class="section">
491<code><pre>
492result = nn::fs::TryXXX();
493
494if(result.IsFailure())
495{
496    if(result &lt;= nn::fs::ResultNotFound())
497    {
498        if(result &lt;= nn::fs::ResultMediaNotFound())
499        {
500            // An SD Card has not been inserted.
501            // NOTE: An SD Card may have been removed after the archive was mounted.
502        }
503        else
504        {
505            // The specified path does not exist.
506            // NOTE: You must handle this error, because it is possible for users to manipulate data on SD Cards.
507        }
508    }
509    else if(result &lt;= nn::fs::ResultAlreadyExists())
510    {
511        // The specified path already exists.
512        // NOTE: This error is not returned when files and directories are deleted.
513        // NOTE: You must handle this error, because it is possible for users to manipulate data on SD Cards.
514    }
515    else if(result &lt;= nn::fs::ResultArchiveInvalidated())
516    {
517        // You must remount the archive.
518        // CAUSE: The SD Card was removed, making the archive invalid.
519        // NOTE: Close all open files, call the nn::fs::Unmount function, and then remount the archive.
520    }
521    else if(result &lt;= nn::fs::ResultOperationDenied())
522    {
523        if(result &lt;= nn::fs::ResultWriteProtected())
524        {
525            // The SD Card is write-locked.
526            // NOTE: This error occurs when you write to an SD Card. This does not occur when you simply open a file.
527        }
528        else if(result &lt;= nn::fs::ResultMediaAccessError())
529        {
530            // This error is only returned when the cause is hardware related, such as a poor connection.
531            // In such cases, recovery may be possible by re-inserting the SD Card, restarting the system, or some other action.
532        }
533        else
534        {
535            // Access was denied for some reason other than those above.
536            // EXAMPLES: You attempted to write to a file that is read-only.
537            //           You attempted to delete a file that was open elsewhere.
538            //           You attempted to move a file or directory so that it would span archives.
539            //           You attempted to delete the root directory.
540            // NOTE: You must handle this error, because it is possible for users to manipulate data on SD Cards.
541        }
542    }
543    else if(result &lt;= nn::fs::ResultNotEnoughSpace())
544    {
545        // There is no available space in the archive or on the storage media.
546        // NOTE: This error may occur when creating a file or directory, or changing the file size.
547        //       If this error occurs when you create a file, delete the file because it might be corrupted.
548        //       If this error occurs when you change the size of a file, the file may have grown to the maximum possible size.
549    }
550    else
551    {
552        // Unexpected error if other than the above.
553        // Failed to access this SD Card. Do not jump to the fatal error screen.
554    }
555}
556</pre></code>
557      </div>
558    </div>
559
560<a name="History"><h2>Revision History</h2></a>
561    <div class="section">
562      <dl class="history">
563        <dt>2011/06/14</dt>
564<dd>Added write-only SDMC archives.</dd>
565<dd>Added note about handling fatal errors.</dd>
566        <dt>2011/03/14</dt>
567<dd>Removed <CODE>ResultMediaAccessError</CODE> from the results when mounting save data and when operating on files and directories.</dd>
568        <dt>2011/03/07</dt>
569<dd>Deleted <CODE>ResultArchiveInvalidated</CODE> from the errors that can occur in functions to create or delete expanded save data.</dd>
570        <dt>2011/02/28</dt>
571<dd>Revised error handling for mounting ROM archives in accordance with changes to API.</dd>
572        <dt>2011/02/07</dt>
573<dd>Changed how mounting expanded save data is handled from recreating the archive using <CODE>ResultBadFormat</CODE> to formatting the SD card.</dd>
574<dd>Deleted <CODE>ResultBadFormat</CODE> from how manipulating expanded save data files and directories are handled.</dd>
575<dd>Revised code so that unexpected errors now result in <CODE>NN_ERR_THROW_FATAL_ALL</CODE>.</dd>
576        <dt>2011/01/05</dt>
577<dd>Deleted <CODE>ResultArchiveInvalidated</CODE> from the errors that can occur when mounting the expanded save data.</dd>
578<dd>Changed the <CODE>Result</CODE> from <CODE>ResultMediaAccessError</CODE> to <CODE>ResultMediaNotFound</CODE> when a damaged SD Card is inserted.</dd>
579        <dt>2010/12/14</dt>
580<dd>Added errors that must not be allowed to occur in retail products.</dd>
581<dd>Added <CODE>ResultNotFormatted</CODE> and <CODE>ResultArchiveInvalidated</CODE> to error handling when expanded save data is created.</dd>
582        <dt>2010/12/13</dt>
583<dd>Split up error handling for file and directory operations by archive type.</dd>
584<dd>Changed how <CODE>ResultOperationDenied</CODE> is handled when expanded save data is mounted.</dd>
585        <dt>2010/12/09</dt>
586<dd>Added <B>Functions for File and Directory Operations</B>.</dd>
587        <dt>2010/12/02</dt>
588<dd>Removed <CODE>ResultNotFound</CODE> from save data error handling.</dd>
589        <dt>2010/11/31</dt>
590<dd>Added <CODE>ResultNotEnoughSpace</CODE> to the errors occurring during file operations.</dd>
591        <dt>2010/11/25</dt>
592<dd>Added <CODE>ResultNotFormatted</CODE> to error handling for expanded save data.</dd>
593        <dt>2010/11/13</dt>
594<dd>Initial version.</dd>
595      </dl>
596    </div>
597
598<hr><p>CONFIDENTIAL</p></body>
599</html>