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>FS_ReadDirectory[W]</title> 7<link rel="stylesheet" href="../../css/nitro.css" type="text/css" /> 8</head> 9<body> 10 11<h1>FS_ReadDirectoryW <img src="../../image/NTR.gif"align="middle"><img src="../../image/TWL.gif" align="middle"></h1> 12<h2>Syntax</h2> 13<pre><code> 14#include <nitro/fs.h> 15 16BOOL FS_ReadDirectory(<a href="../fs_file_type.html">FSFile</a> *dir, <a href="../FSDirectoryEntryInfo.html">FSDirectoryEntryInfo</a> *info); 17BOOL FS_ReadDirectoryW(<a href="../fs_file_type.html">FSFile</a> *file, <a href="../FSDirectoryEntryInfo.html">FSDirectoryEntryInfoW</a> *info); 18</code></pre> 19 20<h2>Arguments</h2> 21<table style="width:100%"> 22<tbody> 23<tr> 24<td style="width:13%"><em><strong>dir</strong></em></td> 25<td style="width:87%">The <A href="../fs_file_type.html"><CODE>FSFile</CODE></a> structure with the directory handle.</td> 26</tr> 27<tr> 28<td style="width:13%"><em><strong>info</strong></em></td> 29<td style="width:87%">The <a href="../FSDirectoryEntryInfo.html"><CODE>FSDirectoryEntryInfo</CODE></a> or <a href="../FSDirectoryEntryInfo.html"><CODE>FSDirectoryEntryInfoW</CODE></a> structure where the entry information should be stored when it is obtained.</td> 30</tr> 31</tbody> 32</table> 33 34<h2>Return Values</h2> 35<p>Returns <CODE>TRUE</CODE> if the entry information was obtained properly; returns <CODE>FALSE</CODE> otherwise. In case of failure, use the <a href="../file/FS_GetResultCode.html"><CODE>FS_GetResultCode</CODE></a> function to get the error details.</p> 36 37<h2>Description</h2> 38<p>Reads only one item of entry information from a directory handle. Each time this function is called, the list position in the directory is incremented by 1. After the final entry is reached, it returns <CODE>FALSE</CODE>. For example, suppose you use the <a href="FS_OpenDirectory.html"><CODE>FS_OpenDirectory</CODE></a> function to open a directory that contains three files. When you call this function using that handle, it returns a value of <CODE>TRUE</CODE> three times. It returns a value of <CODE>FALSE</CODE> the fourth time and thereafter.</p> 39<p>Use the <CODE>FS_ReadDirectory</CODE> function to get the <a href="../FSDirectoryEntryInfo.html"><CODE>longname</CODE></a> field from the entry information in Shift_JIS encoding. Use the <CODE>FS_ReadDirectoryW</CODE> function to get the same field in UTF-16LE. FAT file systems, such as <a href="../archive_sdmc_spec.html">SD Card archives</a>, may use characters that cannot be expressed with Shift_JIS.</p> 40<p>Entry information for <a href="../overview/about_Archive.html#ROM_LTDFILE">TWL-exclusive files</a> can be obtained even when the system is operating in NITRO mode. You can determine whether access to the file is actually possible by checking the <a href="../FSPathInfo.html">FS_ATTRIBUTE_IS_OFFLINE</a> flag of the <a href="../FSDirectoryEntryInfo.html"><CODE>attributes</CODE></a> field.</p> 41 42<h2>Note</h2> 43<ul> 44<li>This function cannot be called from the interrupt handler (IRQ mode). Also, in some cases processing may not end if interrupts are still disabled.</li> 45</ul> 46 47<h2>See Also</h2> 48<p><a href="../fs_file_type.html"><CODE>FSFile</CODE></a><br /> <a href="../FSDirectoryEntryInfo.html"><CODE>FSDirectoryEntryInfo</CODE></a> <br /> <a href="FS_OpenDirectory.html"><CODE>FS_OpenDirectory</CODE></a><br /> <a href="FS_CloseDirectory.html"><CODE>FS_CloseDirectory</CODE></a></p> 49 50<h2>Revision History</h2> 51<p> 522009/06/08 Added link to explanation of TWL-exclusive files.<br />2009/01/08 Added an explanation about TWL-exclusive files.<br />2008/09/02 Added notes concerning a Unicode version of the function.<br />2007/09/18 Initial version. 53</p> 54<hr><p>CONFIDENTIAL</p></body> 55</html> 56