1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 2<html xml:lang="en-US" lang="en-US" xmlns="http://www.w3.org/1999/xhtml"> 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/manpage.css" type="text/css" /> 7 <style type="text/css"><!-- 8 span.static_style 9 { 10 font-size : 8pt; 11 color : white; 12 font-weight : bold; 13 background : #44f; 14 border-left : solid 1px #aaf; 15 border-top : solid 1px #aaf; 16 border-right : solid 1px #00c; 17 border-bottom : solid 1px #00c; 18 padding-left : 2px; 19 padding-right : 2px; 20 } 21 22 span.virtual_style 23 { 24 font-size : 8pt; 25 color : white; 26 font-weight : bold; 27 background : #0a0; 28 border-left : solid 1px #0f0; 29 border-top : solid 1px #0f0; 30 border-right : solid 1px #060; 31 border-bottom : solid 1px #060; 32 padding-left : 2px; 33 padding-right : 2px; 34 } 35 36 span.protected_style 37 { 38 font-size : 8pt; 39 color : white; 40 font-weight : bold; 41 background : #444; 42 border-left : solid 1px #ccc; 43 border-top : solid 1px #ccc; 44 border-right : solid 1px #222; 45 border-bottom : solid 1px #222; 46 padding-left : 2px; 47 padding-right : 2px; 48 } 49 --></style> 50<title>nn::fs</title> 51 </head> 52 <body> 53<h1><CODE>nn::fs</CODE> Namespace</h1> 54<h2>Description</h2> 55 <div class="section"> 56<p>Namespace for the file system API.</p><p>You must first call the <a href="../../nn/fs/Initialize.html"><CODE>nn::fs::Initialize</CODE></a> function to initialize the library before using any of the functions or classes in the <a href="../../nn/fs/Overview.html"><CODE>nn::fs</CODE></a> namespace.</p><p> 57The CTR file system is a collection of <I>archives</I> distinguished by their <I>archive names</I>. Each archive identifies files and directories and carries out the specified operation by receiving <I>archive path name</I>. Archive types differ in various ways such as their available operations, their restrictions on path names, and the number of files that can be opened, but all types can generally be accessed using the same interface.</p><ul><li><a href="briefing/aboutArchive.html">Archives</a></li></ul><p> 58The method of writing code for error handling is different for the FS library than for other libraries.<br />In addition, the handling method may differ depending on the returned <CODE>Result</CODE> value and the type of archive being manipulated.<br /></p><ul><li><a href="briefing/aboutErrorHandling.html">Error Handling</a></li></ul></div> 59 <a name="namespace" id="namespace"> 60<h2>Namespaces</h2> 61 <div class="section"> 62 <table class="members"> 63 <tr> 64 <th> 65<a href="../../nn/fs/hio/Overview.html"><CODE>nn::fs::hio</CODE></a> 66 </th> 67<td>A namespace that includes functions used to directly access files on a PC (for debugging purposes).</td> 68 </tr> </table> 69 </div> 70 </a> <a name="class" id="class"> 71<h2>Classes</h2> 72 <div class="section"> 73 <table class="members"> 74 <tr> 75<th class="category" colspan="2">File and Directory Operations</th> 76 </tr> 77 <tr> 78 <th> 79<a href="../../nn/fs/Directory/Overview.html"><CODE>nn::fs::Directory</CODE></a> 80 </th> 81<td>A class used for directory operations.</td> 82 </tr> 83 <tr> 84 <th> 85<a href="../../nn/fs/FileInputStream/Overview.html"><CODE>nn::fs::FileInputStream</CODE></a> 86 </th> 87<td>Class for reading from files.</td> 88 </tr> 89 <tr> 90 <th> 91<a href="../../nn/fs/FileOutputStream/Overview.html"><CODE>nn::fs::FileOutputStream</CODE></a> 92 </th> 93<td>Class for writing to files.</td> 94 </tr> 95 <tr> 96 <th> 97<a href="../../nn/fs/FileStream/Overview.html"><CODE>nn::fs::FileStream</CODE></a> 98 </th> 99<td>Class for reading from and writing to files.</td> 100 </tr> 101 <tr> 102<th class="category" colspan="2"><CODE>Result</CODE></th> 103 </tr> 104 <tr> 105 <th> 106<a href="../../nn/fs/ResultNotFound/Overview.html"><CODE>nn::fs::ResultNotFound</CODE></a> 107 </th> 108<td>A file, archive, or other filesystem entry could not be found.</td> 109 </tr> 110 <tr> 111 <th> 112<a href="../../nn/fs/ResultMediaNotFound/Overview.html"><CODE>nn::fs::ResultMediaNotFound</CODE></a> 113 </th> 114<td>Could not find or recognize media. This error is associated with <CODE>ResultNotFound</CODE>.</td> 115 </tr> 116 <tr> 117 <th> 118<a href="../../nn/fs/ResultAlreadyExists/Overview.html"><CODE>nn::fs::ResultAlreadyExists</CODE></a> 119 </th> 120<td>A file, archive, or other filesystem entry already exists.</td> 121 </tr> 122 <tr> 123 <th> 124<a href="../../nn/fs/ResultNotEnoughSpace/Overview.html"><CODE>nn::fs::ResultNotEnoughSpace</CODE></a> 125 </th> 126<td>There is no free space.</td> 127 </tr> 128 <tr> 129 <th> 130<a href="../../nn/fs/ResultArchiveInvalidated/Overview.html"><CODE>nn::fs::ResultArchiveInvalidated</CODE></a> 131 </th> 132<td>An archive has become invalid.</td> 133 </tr> 134 <tr> 135 <th> 136<a href="../../nn/fs/ResultOperationDenied/Overview.html"><CODE>nn::fs::ResultOperationDenied</CODE></a> 137 </th> 138<td>An operation was denied.</td> 139 </tr> 140 <tr> 141 <th> 142<a href="../../nn/fs/ResultWriteProtected/Overview.html"><CODE>nn::fs::ResultWriteProtected</CODE></a> 143 </th> 144<td>Write-protected. This error is associated with <CODE>ResultOperationDenied</CODE>.</td> 145 </tr> 146 <tr> 147 <th> 148<a href="../../nn/fs/ResultMediaAccessError/Overview.html"><CODE>nn::fs::ResultMediaAccessError</CODE></a> 149 </th> 150<td>An error occurred during media access. This error is associated with <CODE>ResultOperationDenied</CODE>.</td> 151 </tr> 152 <tr> 153 <th> 154<a href="../../nn/fs/ResultNotFormatted/Overview.html"><CODE>nn::fs::ResultNotFormatted</CODE></a> 155 </th> 156<td>Data region not formatted.</td> 157 </tr> 158 <tr> 159 <th> 160<a href="../../nn/fs/ResultBadFormat/Overview.html"><CODE>nn::fs::ResultBadFormat</CODE></a> 161 </th> 162<td>Data region format invalid.</td> 163 </tr> 164 <tr> 165 <th> 166<a href="../../nn/fs/ResultVerificationFailed/Overview.html"><CODE>nn::fs::ResultVerificationFailed</CODE></a> 167 </th> 168<td>Either verification failed or some form of tampering was detected.</td> 169 </tr> 170 <tr> 171 <th> 172<a href="../../nn/fs/ResultOutOfResource/Overview.html"><CODE>nn::fs::ResultOutOfResource</CODE></a> 173 </th> 174<td>Insufficient resources. You must not allow this error to occur in retail products.</td> 175 </tr> 176 <tr> 177 <th> 178<a href="../../nn/fs/ResultAccessDenied/Overview.html"><CODE>nn::fs::ResultAccessDenied</CODE></a> 179 </th> 180<td>No access rights. You must not allow this error to occur in retail products.</td> 181 </tr> 182 <tr> 183 <th> 184<a href="../../nn/fs/ResultInvalidArgument/Overview.html"><CODE>nn::fs::ResultInvalidArgument</CODE></a> 185 </th> 186<td>The argument is invalid. You must not allow this error to occur in retail products.</td> 187 </tr> 188 <tr> 189 <th> 190<a href="../../nn/fs/ResultNotInitialized/Overview.html"><CODE>nn::fs::ResultNotInitialized</CODE></a> 191 </th> 192<td>A process was called prior to the necessary initialization. You must not allow this error to occur in retail products.</td> 193 </tr> 194 <tr> 195 <th> 196<a href="../../nn/fs/ResultAlreadyInitialized/Overview.html"><CODE>nn::fs::ResultAlreadyInitialized</CODE></a> 197 </th> 198<td>Initialization was run twice. You must not allow this error to occur in retail products.</td> 199 </tr> 200 <tr> 201 <th> 202<a href="../../nn/fs/ResultUnsupportedOperation/Overview.html"><CODE>nn::fs::ResultUnsupportedOperation</CODE></a> 203 </th> 204<td>A feature that is not supported or an operation that is not allowed. You must not allow this error to occur in retail products.</td> 205 </tr> </table> 206 </div> 207 </a> <a name="struct" id="struct"> 208<h2>Structures</h2> 209 <div class="section"> 210 <table class="members"> 211 <tr> 212 <th> 213<a href="../../nn/fs/Attributes/Overview.html"><CODE>nn::fs::Attributes</CODE></a> 214 </th> 215<td>Structure that gives attribute information for directory entries.</td> 216 </tr> 217 <tr> 218 <th> 219<a href="../../nn/fs/DirectoryEntry/Overview.html"><CODE>nn::fs::DirectoryEntry</CODE></a> 220 </th> 221<td>Structure representing a directory entry.</td> 222 </tr> </table> 223 </div> 224 </a> <a name="enum" id="enum"> 225<h2>Enumerated Types</h2> 226 <div class="section"> 227 <table class="members"> 228 <tr> 229 <td width="100"> </td> 230 <th> 231<a href="../../nn/fs/OpenMode.html"><CODE>OpenMode</CODE></a> 232 </th> 233<td>Enumerated constant that specifies file open modes.</td> 234 </tr> 235 <tr> 236 <td width="100"> </td> 237 <th> 238<a href="../../nn/fs/PositionBase.html"><CODE>PositionBase</CODE></a> 239 </th> 240<td>Enumerated constant that indicates the position of file read/writes.</td> 241 </tr> </table> 242 </div> 243 </a> <a name="typedef" id="typedef"> 244<h2><CODE>typedef</CODE> Definitions</h2> 245 <div class="section"> 246 <table class="members"> 247 <tr> 248 <td width="100" /> 249 <th> 250<a href="../../nn/fs/FileReader.html"><CODE>FileReader</CODE></a> 251 </th> 252<td>A <CODE>typedef</CODE> for <CODE><a href="../../nn/fs/FileInputStream/Overview.html">FileInputStream</a></CODE>.</td> 253 </tr> 254 <tr> 255 <td width="100" /> 256 <th> 257<a href="../../nn/fs/FileWriter.html"><CODE>FileWriter</CODE></a> 258 </th> 259<td>Typedef for <a href="../../nn/fs/FileOutputStream/Overview.html"><CODE>FileOutputStream</CODE></a>.</td> 260 </tr> </table> 261 </div> 262 </a> <a name="function" id="function"> 263<h2>Functions</h2> 264 <div class="section"> 265 <table class="members"> 266 <tr> 267<th class="category" colspan="3">ROM Archives</th> 268 </tr> 269 <tr> 270 <td width="100"> </td> 271 <th> 272<a href="../../nn/fs/GetRomRequiredMemorySize.html"><CODE>GetRomRequiredMemorySize</CODE></a> 273 </th> 274<td>Gets the size of memory needed to mount a ROM archive.</td> 275 </tr> 276 <tr> 277 <td width="100"> </td> 278 <th> 279<a href="../../nn/fs/MountRom.html"><CODE>MountRom</CODE></a> 280 </th> 281<td>Mounts a ROM archive.</td> 282 </tr> 283 <tr> 284<th class="category" colspan="3">Save Data Archives</th> 285 </tr> 286 <tr> 287 <td width="100"> </td> 288 <th> 289<a href="../../nn/fs/FormatSaveData.html"><CODE>FormatSaveData</CODE></a> 290 </th> 291<td>Formats a save data region.</td> 292 </tr> 293 <tr> 294 <td width="100"> </td> 295 <th> 296<a href="../../nn/fs/MountSaveData.html"><CODE>MountSaveData</CODE></a> 297 </th> 298<td>Mounts a save data archive.</td> 299 </tr> 300 <tr> 301 <td width="100"> </td> 302 <th> 303<a href="../../nn/fs/CommitSaveData.html"><CODE>CommitSaveData</CODE></a> 304 </th> 305<td>Commits a change to the save data.</td> 306 </tr> 307 <tr> 308<th class="category" colspan="3">Expanded Save Data Archives</th> 309 </tr> 310 <tr> 311 <td width="100"> </td> 312 <th> 313<a href="../../nn/fs/CreateExtSaveData.html"><CODE>CreateExtSaveData</CODE></a> 314 </th> 315<td>Creates an expanded save data memory region.</td> 316 </tr> 317 <tr> 318 <td width="100"> </td> 319 <th> 320<a href="../../nn/fs/MountExtSaveData.html"><CODE>MountExtSaveData</CODE></a> 321 </th> 322<td>Mounts expanded save data.</td> 323 </tr> 324 <tr> 325 <td width="100"> </td> 326 <th> 327<a href="../../nn/fs/DeleteExtSaveData.html"><CODE>DeleteExtSaveData</CODE></a> 328 </th> 329<td>Deletes expanded save data.</td> 330 </tr> 331 <tr> 332<th class="category" colspan="3">For debugging purposes.</th> 333 </tr> 334 <tr> 335 <td width="100"> </td> 336 <th> 337<a href="../../nn/fs/MountSdmc.html"><CODE>MountSdmc</CODE></a> 338 </th> 339<td>Mounts an archive that directly accesses the SD Memory Card (for debugging only).</td> 340 </tr> 341 <tr> 342 <td width="100"> </td> 343 <th> 344<a href="../../nn/fs/ForceEnableLatencyEmulation.html"><CODE>ForceEnableLatencyEmulation</CODE></a> 345 </th> 346<td>Emulates the behavior of a non-volatile memory device that has become degraded. (for debugging purposes)</td> 347 </tr> 348 <tr> 349 <td width="100"> </td> 350 <th> 351<a href="../../nn/fs/ForceDisableLatencyEmulation.html"><CODE>ForceDisableLatencyEmulation</CODE></a> 352 </th> 353<td>Turns off the function to emulate the behavior of a non-volatile memory device that has become degraded. (for debugging purposes)</td> 354 </tr> 355 <tr> 356<th class="category" colspan="3">Initialization</th> 357 </tr> 358 <tr> 359 <td width="100"> </td> 360 <th> 361<a href="../../nn/fs/Initialize.html"><CODE>Initialize</CODE></a> 362 </th> 363<td>Initializes the FS library.</td> 364 </tr> 365 <tr> 366<th class="category" colspan="3">SD Card</th> 367 </tr> 368 <tr> 369 <td width="100"> </td> 370 <th> 371<a href="../../nn/fs/RegisterSdmcInsertedEvent.html"><CODE>RegisterSdmcInsertedEvent</CODE></a> 372 </th> 373<td>Registers the <a href="../../../nn/os/LightEvent/Overview.html"><CODE>nn::os::LightEvent</CODE></a> object that is signaled when an SD Memory Card is inserted.</td> 374 </tr> 375 <tr> 376 <td width="100"> </td> 377 <th> 378<a href="../../nn/fs/UnregisterSdmcInsertedEvent.html"><CODE>UnregisterSdmcInsertedEvent</CODE></a> 379 </th> 380<td>Unregisters the <a href="../../nn/fs/RegisterSdmcInsertedEvent.html">nn::fs::RegisterSdmcInsertedEvent</a> object.</td> 381 </tr> 382 <tr> 383 <td width="100"> </td> 384 <th> 385<a href="../../nn/fs/RegisterSdmcEjectedEvent.html"><CODE>RegisterSdmcEjectedEvent</CODE></a> 386 </th> 387<td>Registers the <a href="../../../nn/os/LightEvent/Overview.html"><CODE>nn::os::LightEvent</CODE></a> object that is signaled when an SD Memory Card is pulled out.</td> 388 </tr> 389 <tr> 390 <td width="100"> </td> 391 <th> 392<a href="../../nn/fs/UnregisterSdmcEjectedEvent.html"><CODE>UnregisterSdmcEjectedEvent</CODE></a> 393 </th> 394<td>Unregisters the <a href="../../nn/fs/RegisterSdmcEjectedEvent.html">nn::fs::RegisterSdmcEjectedEvent</a> object.</td> 395 </tr> 396 <tr> 397 <td width="100"> </td> 398 <th> 399<a href="../../nn/fs/IsSdmcInserted.html"><CODE>IsSdmcInserted</CODE></a> 400 </th> 401<td>Returns a value indicating whether an SD Card has been inserted.</td> 402 </tr> 403 <tr> 404 <td width="100"> </td> 405 <th> 406<a href="../../nn/fs/IsSdmcWritable.html"><CODE>IsSdmcWritable</CODE></a> 407 </th> 408<td>Returns a value indicating whether an SD Card is writable.</td> 409 </tr> 410 <tr> 411 <td width="100"> </td> 412 <th> 413<a href="../../nn/fs/GetSdmcSize.html"><CODE>GetSdmcSize</CODE></a> 414 </th> 415<td>Gets the total capacity and amount of free space on an SD Card.</td> 416 </tr> 417 <tr> 418<th class="category" colspan="3">File and Directory Operations</th> 419 </tr> 420 <tr> 421 <td width="100"> </td> 422 <th> 423<a href="../../nn/fs/DeleteFile.html"><CODE>DeleteFile</CODE></a> 424 </th> 425<td>Deletes a file.</td> 426 </tr> 427 <tr> 428 <td width="100"> </td> 429 <th> 430<a href="../../nn/fs/TryDeleteFile.html"><CODE>TryDeleteFile</CODE></a> 431 </th> 432<td>Deletes a file.</td> 433 </tr> 434 <tr> 435 <td width="100"> </td> 436 <th> 437<a href="../../nn/fs/RenameFile.html"><CODE>RenameFile</CODE></a> 438 </th> 439<td>Renames a file.</td> 440 </tr> 441 <tr> 442 <td width="100"> </td> 443 <th> 444<a href="../../nn/fs/TryRenameFile.html"><CODE>TryRenameFile</CODE></a> 445 </th> 446<td>Renames a file.</td> 447 </tr> 448 <tr> 449 <td width="100"> </td> 450 <th> 451<a href="../../nn/fs/DeleteDirectory.html"><CODE>DeleteDirectory</CODE></a> 452 </th> 453<td>Deletes a directory.</td> 454 </tr> 455 <tr> 456 <td width="100"> </td> 457 <th> 458<a href="../../nn/fs/TryDeleteDirectory.html"><CODE>TryDeleteDirectory</CODE></a> 459 </th> 460<td>Deletes a directory.</td> 461 </tr> 462 <tr> 463 <td width="100"> </td> 464 <th> 465<a href="../../nn/fs/TryDeleteDirectoryRecursively.html"><CODE>TryDeleteDirectoryRecursively</CODE></a> 466 </th> 467<td>Deletes directories recursively.</td> 468 </tr> 469 <tr> 470 <td width="100"> </td> 471 <th> 472<a href="../../nn/fs/CreateFile.html"><CODE>CreateFile</CODE></a> 473 </th> 474<td>Creates a file.</td> 475 </tr> 476 <tr> 477 <td width="100"> </td> 478 <th> 479<a href="../../nn/fs/TryCreateFile.html"><CODE>TryCreateFile</CODE></a> 480 </th> 481<td>Creates a file.</td> 482 </tr> 483 <tr> 484 <td width="100"> </td> 485 <th> 486<a href="../../nn/fs/CreateDirectory.html"><CODE>CreateDirectory</CODE></a> 487 </th> 488<td>Creates a directory.</td> 489 </tr> 490 <tr> 491 <td width="100"> </td> 492 <th> 493<a href="../../nn/fs/TryCreateDirectory.html"><CODE>TryCreateDirectory</CODE></a> 494 </th> 495<td>Creates a directory.</td> 496 </tr> 497 <tr> 498 <td width="100"> </td> 499 <th> 500<a href="../../nn/fs/RenameDirectory.html"><CODE>RenameDirectory</CODE></a> 501 </th> 502<td>Renames a directory.</td> 503 </tr> 504 <tr> 505 <td width="100"> </td> 506 <th> 507<a href="../../nn/fs/TryRenameDirectory.html"><CODE>TryRenameDirectory</CODE></a> 508 </th> 509<td>Renames a directory.</td> 510 </tr> 511 <tr> 512<th class="category" colspan="3">Other</th> 513 </tr> 514 <tr> 515 <td width="100"> </td> 516 <th> 517<a href="../../nn/fs/Unmount.html"><CODE>Unmount</CODE></a> 518 </th> 519<td>Unmounts an archive.</td> 520 </tr> 521 <tr> 522 <td width="100"> </td> 523 <th> 524<a href="../../nn/fs/GetArchiveFreeBytes.html"><CODE>GetArchiveFreeBytes</CODE></a> 525 </th> 526<td>Gets the amount of free space in the archive.</td> 527 </tr> </table> 528 </div> 529 </a> 530<h2>Revision History</h2> 531 <div class="section"> 532 <dl class="history"> 533 <dt>2010/12/09</dt> 534<dd>Listed <CODE>Result</CODE> values that must be removed during development and added information on the <CODE>nn::fs::Attributes</CODE> and <CODE>nn::fs::DirectoryEntry</CODE> structures. 535 </dd> 536 <dt>2010/11/25</dt> 537<dd>Published the <CODE>GetSdmcSize</CODE> function<br /> 538 </dd> 539 <dt>2010/11/13</dt> 540<dd>Added the <CODE>CommitSaveData</CODE> and <CODE>DeleteExtSaveData</CODE> functions. 541 </dd> 542 <dt>2010/11/09</dt> 543<dd>Removed the <CODE>GetFileSystemSize</CODE> and <CODE>ReadExtSaveDataIcon</CODE> functions. 544 </dd> 545 <dt>2010/10/30</dt> 546<dd>Added archive limitations, explanation about <CODE>Result</CODE> objects. 547 </dd> 548 <dt>2010/09/22</dt> 549<dd>Added a description of expanded save data.<BR> 550 </dd> 551 <dt>2010/09/10</dt> 552<dd>Added the <CODE>MountSdmc</CODE> function.<BR> 553 </dd> 554 <dt>2010/09/09</dt> 555<dd>Deleted the <CODE>InitializeForFileSystemEvent</CODE>, <CODE>WaitForInsertSdmc</CODE>, and <CODE>WaitForEjectSdmc</CODE> functions. Added the <CODE>RegisterSdmcInsertedEvent</CODE>, <CODE>UnregisterSdmcInsertedEvent</CODE>, <CODE>RegisterSdmcEjectedEvent</CODE>, and <CODE>UnregisterSdmcEjectedEvent</CODE> functions.<br /> 556 </dd> 557 <dt>2010/01/07</dt> 558<dd>Initial version.<br /> 559 </dd> 560 </dl> 561 </div> 562 <hr><p>CONFIDENTIAL</p></body> 563</html>