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_OpenDirectory[W]</title> 7<link rel="stylesheet" href="../../css/nitro.css" type="text/css" /> 8</head> 9<body> 10 11<h1>FS_OpenDirectory[W] <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_OpenDirectory(<a href="../fs_file_type.html">FSFile</a> *dir, const char *path, u32 mode); 17BOOL FS_OpenDirectoryW(<a href="../fs_file_type.html">FSFile</a> *file, const u16 *path, u32 mode); 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%">FSFile structure where the handle should be stored.</td> 26</tr> 27<tr> 28<td style="width:13%"><em><strong>path</strong></em></td> 29<td style="width:87%">Directory's path</td> 30</tr> 31<tr> 32<td style="width:13%"><em><strong>mode</strong></em></td> 33<td style="width:87%">Specifies the combination of <a href="../FS_DIRMODE.html">FS_DIRMODE_*</a> flags that indicate the mode for accessing the directory.</td> 34</tr> 35</tbody> 36</table> 37 38<h2>Return Values</h2> 39<p>Returns TRUE if the directory handle opens properly; FALSE otherwise. In case of failure, use <code><a href="../file/FS_GetResultCode.html">FS_GetResultCode()</a></code> to get the error details.</p> 40 41<h2>Description</h2> 42<p>Opens the handle for the specified directory.<br />You can use the <CODE>FS_OpenDirectory</CODE> function when the path is specified using <CODE>Shift_JIS</CODE>, and the <CODE>FS_OpenDirectoryW</CODE> function when the path is specified using <CODE>UTF16-LE</CODE>. The results that are obtained will be the same. You can list all entry information within a directory, one at a time, by calling <code><a href="FS_ReadDirectory.html">FS_ReadDirectory()</a></code> with the handle that is obtained. After using a handle, you must call <code><a href="FS_CloseDirectory.html">FS_CloseDirectory()</a></code> to free it. The function returns FALSE in the following situations: 43</p> 44<ul> 45<li>If the target archive does not support opening directories</li> 46<li>If the specified directory does not exist</li> 47</ul> 48 49<h2>Note</h2> 50<ul> 51<li>This function cannot be called from the interrupt handler (IRQ mode). Also, in some cases processing may not end if interrupts are left prohibited.</li> 52</ul> 53 54<h2>See Also</h2> 55<p><code><a href="../fs_file_type.html">FSFile</a> <a href="../FSDirectoryEntryInfo.html">FSDirectoryEntryInfo</a> <a href="../FSDirectoryEntryInfo.html">FSDirectoryEntryInfoW</a> <br /> <a href="FS_ReadDirectory.html">FS_ReadDirectory</a> <a href="FS_CloseDirectory.html">FS_CloseDirectory</a></code></p> 56 57<h2>Revision History</h2> 58<p> 592008/09/02 Added notes concerning a Unicode version of the function.<br />2008/07/16 Revised the description to use FS_GetResultCode() for getting the error code in cases of failure.<br />2007/09/18 Initial version. 60</p> 61<hr><p>CONFIDENTIAL</p></body> 62</html> 63