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_GETPATH</title>
9<LINK rel="stylesheet" href="../../css/nitro.css" type="text/css">
10</head>
11
12<body>
13
14<h1 align="left">FS_COMMAND_GETPATH <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_GETPATH */);<br>
22  </CODE><br>
23  </dd>
24</dl>
25
26<H2>Description</H2>
27<P>Operating specifications for the archive command <code>FS_COMMAND_GETPATH</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.getpath</code> that is stored in <code>p_file</code>.
33This variable is defined in <code>nitro/fs/file.h</code> as shown below:
34
35typedef struct
36{
37    u8     *buf;
38    u32    buf_len;
39    u16    total_len;
40    u16    dir_id;
41} FSGetPathInfo;</code> </PRE>
42</BLOCKQUOTE>
43<BLOCKQUOTE>Argument content is listed below:
44</BLOCKQUOTE>
45<CENTER>
46<TABLE border="1" width="50%">
47  <TBODY>
48    <TR>
49      <TD style="text-align : center;" width="95">Arguments</TD>
50      <TD style="text-align : center;" width="522">Content</TD>
51    </TR>
52    <TR>
53      <TD width="95" style="text-align : center;">buf</TD>
54      <TD width="522">This indicates a pointer to the memory that stores the acquired absolute path name string.
55      If this value is <code>NULL</code>, there is no need to acquire an absolute path name string.</TD>
56    </TR>
57    <TR>
58      <TD style="text-align : center;"><code><EM><STRONG>buf_len</STRONG></EM></code></TD>
59      <TD>This indicates the memory size of <code>buf</code> (bytes).</TD>
60    </TR>
61    <TR>
62      <TD style="text-align : center;"><code><EM><STRONG>total_len</STRONG></EM></code></TD>
63      <TD>This indicates the length of a valid absolute path name string that has already been calculated.
64      If this value is <code>0</code>, you must configure properly.</TD>
65    </TR>
66    <TR>
67      <TD style="text-align : center;"><code><EM><STRONG>dir_id</STRONG></EM></code></TD>
68      <TD>If the target is a directory, this indicates a position; if the target is a file, this indicates the position of the directory to which it belongs.<br />
69      If <code>total_length</code> is <code>0</code>, you must correctly set the value.</TD>
70    </TR>
71  </TBODY>
72</TABLE>
73</CENTER>
74<BR>
75<HR>
76<B>Actions required of this command</B>
77<BLOCKQUOTE>
78<PRE><code>p_file</code> holds either file information or directory position information.
79You can determine which it holds with the <code><a href="../file/FS_IsFile.html">FS_IsFile</a></code> function or the <code><a href="../file/FS_IsDir.html">FS_IsDir</a></code> function.
80The argument variables are set as shown below:
81
82If the argument <code>total_len</code> is <code>0</code>, the length of the absolute path name string indicated by <code>p_file</code>, including the terminating '<code>\0</code>', will be set in <code>total_len</code>.
83  If <code>p_file</code> is a directory its value will be set in <code>dir_id</code>; if <code>p_file</code> is a file, the position of the directory that it belongs to will be set in <code>dir_id</code>.
84  If <code>total_len</code> is not <code>0</code>, it is assured that this command has already made this setting.
85
86If the argument <code>buf</code> is not <code>NULL</code>, the absolute path name string indicated by <code>p_file</code>, including the terminating '<code>\0</code>' will be stored in memory.
87  However, if <code>buf_len</code> is less than <code>total_len</code>, <code>FS_RESULT_FAILURE</code> must be returned.
88  At this time, it is possible to either store as much of the string as possible, or store nothing.</PRE>
89</BLOCKQUOTE>
90<HR>
91<B>Default Implementation</B>
92<BLOCKQUOTE>Seek results from the provided arguments, using only the <code><a href="fs_command_seekdir_spec.html">FS_COMMAND_SEEKDIR</a></code> and <code><a href="fs_command_readdir_spec.html">FS_COMMAND_READDIR</a></code> commands.</BLOCKQUOTE>
93<HR>
94<B>Command Results</B><BR>
95
96<BLOCKQUOTE>
97<PRE>If <code>FS_RESULT_SUCCESS</code> is returned by the command, it is determined that a valid absolute path name string length has been set in <code>total_len</code>.
98If buf is not NULL, the absolute path name string, including the terminating '<code>\0</code>' has been stored.
99Otherwise it will be determined that <code>buf</code> is not <code>NULL</code>, and that <code>buf_len</code> is less than <code>total_len</code>.</PRE>
100</BLOCKQUOTE>
101<HR>
102<B>Functions that use this command</B><BR>
103<BLOCKQUOTE><code>FS_GetPathLength</code> <BR><code>FS_GetPathName</code></BLOCKQUOTE>
104<h2>See Also</h2>
105<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>
106
107<H2>Revision History</H2>
108<P>
1092004/08/25 Corrected error: <code>FSIdFile</code> is changed to <code>FS_IsFile</code>.<br> 2004/07/12 Initial version.
110</P>
111<hr><p>CONFIDENTIAL</p></body>
112</html>
113