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>Error Handling</title> 8</head> 9<body> 10 <h1>File System Archives</h1> 11 12 <h2>Description</h2> 13 <p> 14 Use the format <CODE>"<archive name>:<archive path>"</CODE> to specify path name for file and directory operations. For archives with a hierarchical directory structure, slashes ("/") are used as the directory delimiter. 15 </p> 16 <p> 17 Archives must be mounted before they can be accessed. Each archive type has its own mount function, and the arguments of those functions differ. You specify an archive name when mounting an archive, and then you can then access that archive using a path that begins with the archive name. Once you no longer need the archive, you can unmount it by calling <a href="../../nn/fs/Unmount.html"><CODE>nn::fs::Unmount</CODE></a> function. 18 </p> 19 20 <h3>ROM Archives</h3> 21 <p> 22 A ROM archive is a read-only archive used to access a ROMFS created at build time. When ROM archives are used, they require a working memory region to be passed by the user application. These archives therefore require that a working memory region be passed as an argument when calling the <a href="../../nn/fs/MountRom.html"><CODE>nn::fs::MountRom</CODE></a> function. The number of files and the number of directories that can be opened in ROM archives are passed as arguments to the <a href="../../nn/fs/MountRom.html"><CODE>nn::fs::MountRom</CODE></a> function, and the only restriction on these numbers is the amount of available memory. We recommend passing the required number for arguments to the <a href="../../nn/fs/MountRom.html"><CODE>nn::fs::MountRom</CODE></a> function. 23 </p> 24 <p> 25 You can also choose whether to cache metadata such as the ROM filenames and directory names. If you enable caching, a larger working region will be required, but your application will be able to open files and work with directories more quickly. 26 </p> 27 28 <h3>Save Data Archives</h3> 29 <p> 30 Save data archives are for referencing program-specific save data regions. For programs launched from a CTR card (emulation memory during development), these archives access backup memory on the CTR card. For programs launched from NAND memory, these archives access save data created in NAND memory. 31 </p> 32 <p> 33 Save data archives use a file system with a hierarchical directory structure, so they support the same types of file and directory operations that typical file systems do. 34 </p> 35 <p> 36 Although the <a href="../../nn/fs/MountSaveData.html"><CODE>nn::fs::MountSaveData</CODE></a> function is used to mount save data archives, you must format the save data region with the <a href="../../nn/fs/FormatSaveData.html"><CODE>nn::fs::FormatSaveData</CODE></a> function before you use save data for the first time. When you format a save data region, you can specify the maximum number of files and directories that can be created in it. 37 </p> 38 <p> 39 You can also decide whether to duplicate data in a save data archive as a means of preventing data loss due to corruption. However, using data duplication reduces the amount of actual writable data in the save data archive to 40% of the total save data region size. 40 </p> 41 42 <h3>Expanded Save Data Archive</h3> 43 <p>Expanded save data archives are archives created on an SD Card where the data memory region is managed separately from save data. In order to use an extended save data archive, the application must explicitly create one. 44 </p> 45 46 <h3>SDMC Archives</h3> 47 <p> 48 SDMC archives are for directly referencing SD Cards for debugging purposes. An inserted SD Card can be mounted using the <a href="../../nn/fs/MountSdmc.html"><CODE>nn::fs::MountSdmc</CODE></a> function. To mount a previously mounted SD Card that has been pulled out and then re-inserted, you must first unmount the card using the <a href="../../nn/fs/Unmount.html"><CODE>nn::fs::Unmount</CODE></a> function, then call the <a href="../../nn/fs/MountSdmc.html"><CODE>nn::fs::MountSdmc</CODE></a> function again. 49 </p> 50 <p> 51 Note that SDMC archives are generally only for debugging and cannot be accessed from retail versions. 52 </p> 53 54 <h3>HIO Archives</h3> 55 <p> 56 An HIO archive recognizes the contents of a specific directory (on the PC specified by the <SPAN class="argument">hostPath</SPAN> argument) as a single archive. This feature is provided only for debugging purposes. 57 </p> 58 <p> 59 HIO archives are only for debugging and cannot be accessed from retail versions. The <SPAN class="argument">Result</SPAN> values returned by the HIO archive may not always match those of other archives. Also, behavior could differ depending on the SDK version. Consider this only as an auxiliary feature when debugging. 60 </p> 61 62 63 <h2>Archive Limitations</h2> 64 <p> 65 All archive types entail the following limitations. 66 </p> 67 68 <h3>File Operations</h3> 69 <table> 70 <thead> 71 <th></th><th>R/W</th><th>Changing the Size of Docking Windows</th><th>Creation</th><th>Opening Multiple Instances</th> 72 </thead> 73 <tr> 74 <th>ROM Archives</th><td>R</td><td>Impossible</td><td>Impossible</td><td>Only when all read-only</td> 75 </tr> 76 <tr> 77 <th>Save Data Archives</th><td>R/W</td><td>Possible</td><td><a href="../../../nn/fs/FileStream/Overview.html">FileStream</a><br /><a href="../../../nn/fs/FileOutputStream/Overview.html">FileOutputStream</a><br /><a href="../../../nn/fs/TryCreateFile.html">nn::fs::TryCreateFile</a></td><td>Only when all read-only</td> 78 </tr> 79 <tr> 80 <th>Expanded Save Data Archive</th><td>R/W</td><td>Impossible</td><td><CODE>nn::fs::TryCreateFile</CODE> Function only</td><td>Only when all read-only</td> 81 </tr> 82 <tr> 83 <th>SDMC Archives</th><td>R/W</td><td>Possible</td><td><a href="../../../nn/fs/FileStream/Overview.html">FileStream</a><br /><a href="../../../nn/fs/FileOutputStream/Overview.html">FileOutputStream</a><br /><a href="../../../nn/fs/TryCreateFile.html">nn::fs::TryCreateFile</a></td><td>Possible</td> 84 </tr> 85 <tr> 86 <th>HIO Archives</th><td>R/W</td><td>Possible</td><td><a href="../../../nn/fs/FileStream/Overview.html">FileStream</a><br /><a href="../../../nn/fs/FileOutputStream/Overview.html">FileOutputStream</a><br /><a href="../../../nn/fs/TryCreateFile.html">nn::fs::TryCreateFile</a></td><td>(Operation not guaranteed)</td> 87 </tr> 88 </table> 89 90 <h3>Character restrictions</h3> 91 <table> 92 <thead> 93 <th></th><th>Filename Length</th><th>Path Length (*1)</th><th>Case-sensitive</th><th>Forbidden characters</th> 94 </thead> 95 <tr> 96 <th>ROM Archives</th><td>-</td><td>253 characters</td><td>Yes</td><td>(※3)</td> 97 </tr> 98 <tr> 99 <th>Save Data Archives</th><td>16 characters</td><td>253 characters</td><td>Yes</td><td>(※2)(※3)</td> 100 </tr> 101 <tr> 102 <th>Expanded Save Data Archive</th><td>16 characters</td><td>248 characters</td><td>Yes</td><td>(※2)(※3)</td> 103 </tr> 104 <tr> 105 <th>SDMC Archives</th><td>According to VFAT limitations</td><td>253 characters</td><td>No</td><td>(※3)</td> 106 </tr> 107 <tr> 108 <th>HIO Archives</th><td colspan="4">According to host PC limitations</td> 109 </tr> 110 </table> 111 112 <p>*1: Not including archive names.</p> 113 <p>(※2) <font color="red">No error will occur if symbols other than "/" are included in the path. But if any of the following characters or names is included in a file name or directory name, operation is not guaranteed. </font></p> 114 <p>(※3) Although the Function Reference Manual for CTR-SDK 0.14 and earlier had a section called Usable Characters for VFAT, note that if any of the following characters or names is included in a file name or directory name, operation is not guaranteed. </p> 115 116 <h3>Unusable Characters in File and Directory Names</h3> 117 <pre> 118 \ / : * ? " < > | , ; = + [ ] and single-byte spaces 119 </pre> 120 121 <h3>Unusable File and Directory Names</h3> 122 <pre> 123 CON, PRN, NUL, AUX, LPT1, LPT2, LPT3, LPT4, COM1, COM2, COM3, COM4 124 con, prn, nul, aux, lpt1, lpt2, lpt3, lpt4, com1, com2, com3, com4 125 </pre> 126 127 128 <h2>Revision History</h2> 129 <div class="section"> 130 <dl class="history"> 131 <dt>2010/11/18</dt> 132 <dd>Added 'single-byte space' to the list of unusable characters</dd> 133 <dt>2010/11/13</dt> 134 <dd>Initial version.</dd> 135 </dl> 136 </div> 137 138<hr><p>CONFIDENTIAL</p></body> 139</html> 140