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 http-equiv="Content-Style-Type" content="text/css">
7<LINK rel="stylesheet" type="text/css" href="../CSS/revolution.css">
8<title>VFFileSearchFirst(W)</title>
9</head>
10
11<body>
12
13<h1>VFFileSearchFirst(W)</h1>
14
15<h2>C Specification</h2>
16<dl><dd><pre><code>
17#include &lt;revolution/vf.h&gt;
18
19#define VF_ATTR_RDONLY		((u8)0x01)
20#define VF_ATTR_HIDDEN		((u8)0x02)
21#define VF_ATTR_SYSTEM		((u8)0x04)
22#define VF_ATTR_VOLUME		((u8)0x08)
23#define VF_ATTR_DIR		((u8)0x10)
24#define VF_ATTR_ARCH		((u8)0x20)
25#define VF_ATTR_NONE		((u8)0x40)
26#define VF_ATTR_ALL		((u8)0x7f)
27#define VF_ATTR_CAND		((u8)0x80)
28
29typedef s32	VFErr;
30typedef u16	VFWchar;
31
32VFErr VFFileSearchFirst( VFDta* dta, const char* path, u8 attr );
33VFErr VFFileSearchFirstW( VFWDta* dta, const VFWchar* path, u8 attr );
34</code></pre></dd></dl>
35
36<h2>Arguments</h2>
37<p>
38<TABLE border="1" >
39  <tr>
40<TD valign="top" width="120" bgcolor="#ffffe8"><CODE><STRONG><EM>dta</EM></STRONG></CODE></TD>
41<TD width="520">The address that stores file search information.</TD>
42  </tr>
43  <tr>
44<TD valign="top" width="120" bgcolor="#ffffe8"><CODE><STRONG><EM>path</EM></STRONG></CODE></TD>
45<TD width="520">The address that stores path and file name.<BR>Either a full or relative path may be specified.</TD>
46  </tr>
47  <tr>
48<TD valign="top" width="120" bgcolor="#ffffe8"><CODE><STRONG><EM>attr</EM></STRONG></CODE></TD>
49<TD width="520">Specifies the file attributes. See below.
50    </TD>
51
52  </tr>
53</TABLE>
54</p>
55
56<h2>File Attributes</h2>
57<p>
58    <TABLE border="1" >
59    <tr>
60<TD valign="top" width="60" bgcolor="#ffffe8"><CODE><STRONG><EM>VF_ATTR_RDONLY=0x01</EM></STRONG></CODE></TD>
61<TD width="480">Read-only.
62    </tr>
63    <tr>
64<TD valign="top" width="60" bgcolor="#ffffe8"><CODE><STRONG><EM>VF_ATTR_HIDDEN=0x02</EM></STRONG></CODE></TD>
65<TD width="480">Hidden file.
66    </tr>
67    <tr>
68<TD valign="top" width="60" bgcolor="#ffffe8"><CODE><STRONG><EM>VF_ATTR_SYSTEM=0x04</EM></STRONG></CODE></TD>
69<TD width="480">System file.
70    </tr>
71    <tr>
72<TD valign="top" width="60" bgcolor="#ffffe8"><CODE><STRONG><EM>VF_ATTR_VOLUME=0x08</EM></STRONG></CODE></TD>
73<TD width="480">Volume label.
74    </tr>
75    <tr>
76<TD valign="top" width="60" bgcolor="#ffffe8"><CODE><STRONG><EM>VF_ATTR_DIR=0x10</EM></STRONG></CODE></TD>
77<TD width="480">Subdirectory.
78    </tr>
79    <tr>
80<TD valign="top" width="60" bgcolor="#ffffe8"><CODE><STRONG><EM>VF_ATTR_ARCH=0x20</EM></STRONG></CODE></TD>
81<TD width="480">Archive.
82    </tr>
83    <tr>
84<TD valign="top" width="60" bgcolor="#ffffe8"><CODE><STRONG><EM>VF_ATTR_NONE=0x40</EM></STRONG></CODE></TD>
85<TD width="480">No attributes.
86    </tr>
87    <tr>
88<TD valign="top" width="60" bgcolor="#ffffe8"><CODE><STRONG><EM>VF_ATTR_ALL=0x3f</EM></STRONG></CODE></TD>
89<TD width="480">All files.<br>Indicates all files and directories that exist in the specified directory. All files will be search targets, whether they have a given attribute or not.
90    </tr>
91    <tr>
92<TD valign="top" width="60" bgcolor="#ffffe8"><CODE><STRONG><EM>VF_ATTR_CAND=0x80</EM></STRONG></CODE></TD>
93<TD width="480">&lt;&lt;Search Mode&gt;&gt;<br>Although the file search is usually made by performing a logical OR operation on specified attributes, the search is made by performing a logical AND operation on attributes if <CODE>VF_ATTR_CAND</CODE> is set.
94    </tr>
95  </TABLE>
96
97<h2>Return Values</h2>
98<PRE>
99When successful, 0.
100When failed, a <code><a href="./VFErr.html">VFErr</a></code> other than 0.
101</PRE>
102
103
104<H2>Description</H2>
105<p>
106This function searches for a file that matches the specified file name. Search results are stored in <CODE><STRONG><EM>dta</EM></STRONG></CODE>. Among the search results, <CODE>longName</CODE> is restricted to files that have a long file name. That long file name is then stored.<br>In this case, the short file name is stored in fileName.<BR>The obtained <CODE>dta</CODE> information is necessary when <code><a href="./VFFileSearchNext.html">VFFileSearchNext</a></code> is issued, so do not destroy this buffer. <br>The <code><a href="./VFDta.html">VFDta</a></code> structure is a region used for VF internal processes. Operations cannot be guaranteed if you edit this structure.<BR>To reference the <CODE>VFDta</CODE> member, use the <CODE>VFDta</CODE> member reference macro; do not directly access the member.<br> The <CODE>path</CODE> value specifies the address of the buffer storing the path and file name to be searched for.<br> Two types of wildcards, an asterisk (*) and a question mark (?), can be used when specifying this file name.<br> Including NULLs, the maximum length of a file name is 512 bytes.<br> In addition, the maximum length of the path name is 520 bytes, including the NULL character.<br> Paths can be specified as either relative or absolute.<br> <br> If attributes of the file to be searched for are specified in <CODE>attr</CODE>, only files with the attributes specified are searched for. When this parameter is specified as <CODE>ATTR_NONE(=0)</CODE>, only files without attributes are searched for. When <CODE>ATTR_ALL</CODE>, all files and subdirectories are searched for. In addition, OR searching can be performed for specified attributes; to perform AND searches, specify <CODE>ATTR_CAND</CODE> for <CODE><STRONG><EM>attr</EM></STRONG></CODE>. <br>
107</p>
108
109<h2>See Also</h2>
110<p>
111<code><a href="./VFFileSearchNext.html">VFFileSearchNext</a></code>, <code><a href="./VFDta.html">VFDta</a></code>
112</p>
113
114<H2>Revision History</H2>
115<p>
1162006/10/25<br>2007/05/08 Revised Description.
117</p>
118
119
120<hr><p>CONFIDENTIAL</p></body>
121</html>
122