#include <revolution/vf.h>
#define VF_ATTR_RDONLY ((u8)0x01)
#define VF_ATTR_HIDDEN ((u8)0x02)
#define VF_ATTR_SYSTEM ((u8)0x04)
#define VF_ATTR_VOLUME ((u8)0x08)
#define VF_ATTR_DIR ((u8)0x10)
#define VF_ATTR_ARCH ((u8)0x20)
#define VF_ATTR_NONE ((u8)0x40)
#define VF_ATTR_ALL ((u8)0x7f)
#define VF_ATTR_CAND ((u8)0x80)
typedef s32 VFErr;
typedef u16 VFWchar;
VFErr VFFileSearchFirst( VFDta* dta, const char* path, u8 attr );
VFErr VFFileSearchFirstW( VFWDta* dta, const VFWchar* path, u8 attr );
dta |
The address that stores file search information. |
path |
The address that stores path and file name. Either a full or relative path may be specified. |
attr |
Specifies the file attributes. See below. |
VF_ATTR_RDONLY=0x01 |
Read-only. |
VF_ATTR_HIDDEN=0x02 |
Hidden file. |
VF_ATTR_SYSTEM=0x04 |
System file. |
VF_ATTR_VOLUME=0x08 |
Volume label. |
VF_ATTR_DIR=0x10 |
Subdirectory. |
VF_ATTR_ARCH=0x20 |
Archive. |
VF_ATTR_NONE=0x40 |
No attributes. |
VF_ATTR_ALL=0x3f |
All files. 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. |
VF_ATTR_CAND=0x80 |
<<Search Mode>> 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 VF_ATTR_CAND is set.
|
When successful, 0.
When failed, a VFErr other than 0.
This function searches for a file that matches the specified file name. Search results are stored in dta. Among the search results, longName is restricted to files that have a long file name. That long file name is then stored.
In this case, the short file name is stored in fileName.
The obtained dta information is necessary when VFFileSearchNext is issued, so do not destroy this buffer.
The VFDta structure is a region used for VF internal processes. Operations cannot be guaranteed if you edit this structure.
To reference the VFDta member, use the VFDta member reference macro; do not directly access the member.
The path value specifies the address of the buffer storing the path and file name to be searched for.
Two types of wildcards, an asterisk (*) and a question mark (?), can be used when specifying this file name.
Including NULLs, the maximum length of a file name is 512 bytes.
In addition, the maximum length of the path name is 520 bytes, including the NULL character.
Paths can be specified as either relative or absolute.
If attributes of the file to be searched for are specified in attr, only files with the attributes specified are searched for. When this parameter is specified as ATTR_NONE(=0), only files without attributes are searched for. When ATTR_ALL, all files and subdirectories are searched for. In addition, OR searching can be performed for specified attributes; to perform AND searches, specify ATTR_CAND for attr.
2006/10/25
2007/05/08 Revised Description.
CONFIDENTIAL