1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<html>
3
4<head>
5<META http-equiv="Content-Type" content="text/html; charset=windows-1252">
6<META name="GENERATOR" content="IBM WebSphere Studio Homepage Builder Version 8.0.0.0 for Windows">
7<META http-equiv="Content-Style-Type" content="text/css">
8<title>FS_COMMAND_SEEKDIR</title>
9<LINK rel="stylesheet" href="../../css/nitro.css" type="text/css">
10</head>
11
12<body>
13
14<h1 align="left">FS_COMMAND_SEEKDIR <img src="../../image/NTR.gif"align="middle"><img src="../../image/TWL.gif" align="middle"></h1>
15<h2>Definition</h2>
16
17<dl>
18  <dd>
19  <BR>
20  <CODE>FSResult FS_ARCHIVE_PROC_FUNC(FSFile *p_file, FSCommandType command /*
21  = FS_COMMAND_SEEKDIR */);<br>
22  </CODE><br>
23  </dd>
24</dl>
25
26<H2>Description</H2>
27<P>Operating specifications for the archive command <code>FS_COMMAND_SEEKDIR</code> are shown below: <BR> <BR>
28
29<HR>
30<B>Arguments passed to this command</B>
31<BLOCKQUOTE>
32<PRE>This command takes as a command argument the variable <code>arg.seekdir</code> that is stored in <code>p_file</code>.<br />
33This variable is defined in <code>nitro/fs/file.h</code> as shown below:
34
35typedef struct {
36   <a href="../fs_dir_pos_type.html">FSDirPos</a>        pos;
37} FSSeekDirInfo;</code> </PRE>
38</BLOCKQUOTE>
39<BLOCKQUOTE>Argument content is listed below:
40</BLOCKQUOTE>
41<CENTER>
42<TABLE border="1" width="50%">
43  <TBODY>
44    <TR>
45      <TD style="text-align : center;" width="95">Arguments</TD>
46      <TD style="text-align : center;" width="522">Content</TD>
47    </TR>
48    <TR>
49      <TD width="95" style="text-align : center;"><code><EM><STRONG>pos</STRONG></EM></code></TD>
50      <TD width="522">The directory position to be moved is stored in a <code><a href="../fs_dir_pos_type.html">FSDirPos</a></code> type.<br />
51      The <code><a href="fs_command_readdir_spec.html">FS_COMMAND_READDIR</a></code> command generates this value.</TD>
52    </TR>
53  </TBODY>
54</TABLE>
55</CENTER>
56<BR>
57<HR>
58<B>Actions required of this command</B>
59<BLOCKQUOTE>
60<PRE>It sets the <code>p_file</code> variable <code>prop.dir</code> as shown below:<br />
61
62Sets the directory position that is held by the argument <code>pos</code> in <code>prop.dir.pos</code>.
63  If both <code>pos.index</code> and <code>pos.pos</code> are <code>0</code>, it signifies the top of the directory array position.<br />
64  The set values are used by subsequent <code>FS_COMMAND_SEEKDIR</code> and <code><a href="fs_command_readdir_spec.html">FS_COMMAND_READDIR</a></code> commands.
65  You may determine your own meanings for the <code>pos</code> name variables as long as they are appropriate arguments for these commands.
66
67Sets the index for the parent directory at the directory position indicated by the argument <code>pos</code> in <code>prop.dir.parent</code>.
68  <code>pos.own_id = 0</code>&quot; signifies the root directory.
69  In the case of the root directory, this sets the total number of directories into <code>prop.dir.parent</code>.<br />
70  The set values are used by subsequent <code><a href="fs_command_getpath_spec.html">FS_COMMAND_GETPATH</a></code> commands.
71</PRE>
72</BLOCKQUOTE>
73<HR>
74<B>Default Implementation</B>
75<BLOCKQUOTE>The command sets values based on the following determinants:
76</BLOCKQUOTE>
77<CENTER>
78<TABLE border="1">
79  <TBODY>
80    <TR>
81      <TD width="185">prop.dir.pos.arc</TD>
82      <TD width="432">Uses the arguments as is</TD>
83    </TR>
84    <TR>
85      <TD width="185">prop.dir.pos.own_id</TD>
86      <TD width="432">Uses the arguments as is</TD>
87    </TR>
88    <TR>
89      <TD width="185">prop.dir.pos.index</TD>
90      <TD width="432">The position where the next directory entry is located within FNT.<BR>
91      (Based on the NitroROM format.)</TD>
92    </TR>
93    <TR>
94      <TD width="185">prop.dir.pos.pos</TD>
95      <TD width="432">The given index, if the next directory entry was a file.<BR>
96      Incremented by 1 every time FS_COMMAND_READ succeeds.<BR>
97      (Based on the NitroROM format.)</TD>
98    </TR>
99    <TR>
100      <TD>prop.dir.parent</TD>
101      <TD>Parent directory's index, or total number of directories.<br /> (Conforms to NitroROM format)</TD>
102    </TR>
103  </TBODY>
104</TABLE>
105</CENTER>
106<BLOCKQUOTE>As long as the archive's FNT conforms to the NitroROM format (determined by using the archive read callback function), this information is acquired from the FNT entry block that is indicated by <code>pos.own_id</code>.
107</BLOCKQUOTE>
108<HR>
109<B>Command Results</B><BR>
110
111<BLOCKQUOTE>
112<PRE>If this command returns <code>FS_RESULT_SUCCESS</code>, <code>p_file</code> becomes a handle that contains directory position information.
113Subsequently the <code><a href="../file/FS_IsDir.html">FS_IsDir</a></code> function returns <code>TRUE</code>.
114It can also be used as an argument in functions that operate on directories.</PRE>
115</BLOCKQUOTE>
116<HR>
117<B>Functions that use this command</B><BR>
118<BLOCKQUOTE>FS_SeekDir <code><a href="../file/FS_RewindDir.html">FS_RewindDir</a></code><br /> (indirectly from the default <code><a href="fs_command_findpath_spec.html">FS_FINDPATH</a></code> command) FS_ChangeDir FS_OpenFile <code><a href="../file/FS_ConvertPathToFileID.html">FS_ConvertPathToFileID</a></code><br /> (indirectly from the default <a href="fs_command_getpath_spec.html">FS_GETPATH</a> command) FS_GetPathName FS_GetPathLength</BLOCKQUOTE>
119<h2>See Also</h2>
120<p><code><a href="../fs_archive_type.html">FSArchive</a></code>, <code><a href="../fs_archive_proc_func_type.html">FS_ARCHIVE_PROC_FUNC</a></code>, <code><a href="../fs_command_type_const.html">FS_COMMAND_*</a></code>, <code><a href="../archive/FS_SetArchiveProc.html">FS_SetArchiveProc</a></code></p>
121
122<H2>Revision History</H2>
123<P>2004/07/12 Initial version.</P>
124<hr><p>CONFIDENTIAL</p></body>
125</html>
126