The file names include the full path.
The following wildcard specifiers are permitted in searchPattern.
| Wildcard character | Description |
| * | Zero or more characters. |
| ? | Exactly one character. |
Characters other than the wildcard specifiers represent themselves. For example, the searchPattern string "*t" searches for all names in path ending with the letter "t". The searchPattern string "s*" searches for all names in path beginning with the letter "s".
The matching behavior of searchPattern when the extension is exactly three characters long is different from when the extension is more than three characters long. A searchPattern of exactly three characters returns files having an extension of three or more characters. A searchPattern of one, two, or more than three characters returns only files having extensions of exactly that length.
Note |
|---|
| The A search pattern using the asterisk matches all extensions with a wildcard on the end, while a search pattern using the question mark does not use a wildcard. For example, given two files, file1.txt and file1.txtother, in a directory, a search pattern of "file?.txt" returns just the first file, while a search pattern of "file*.txt" returns both files. |
The following list shows the behavior of different lengths for the searchPattern parameter:
-
"*.abc*" returns files having an extension of.abc,.abcd,.abcde,.abcdef, and so on.
-
"*.abcd" returns only files having an extension of.abcd.
-
"*.abcde" returns only files having an extension of.abcde.
-
"*.abcdef" returns only files having an extension of.abcdef.
The path parameter is permitted to specify relative or absolute path information. Relative path information is interpreted as relative to the current working directory. To obtain the current working directory, see GetCurrentDirectory.
The path parameter is not case-sensitive.
The following table lists examples of other typical or related I/O tasks.