File Function | |
Determine if any file matches a given file specification.
Namespace:
XSharp.Core
Assembly:
XSharp.Core (in XSharp.Core.dll) Version: 2.19
Syntax FUNCTION File(
cFileSpec AS STRING
) AS LOGIC
public static bool File(
string cFileSpec
)
Request Example
View SourceParameters
- cFileSpec
- Type: String
The file specification for the search. Besides a file name, this specification can include an optional drive, directory, and extension.
The file name and extension can include the standard wildcard characters (* and ?).
If you do not specify a drive and directory, this function searches only the SetDefault() and SetPath() settings.
Note also that File() does not recognize hidden or system files in its search.If cFileSpec is longer
than 127 characters and has no path X# searches in the current directory only
Return Value
Type:
Logic
TRUE if any file matches the
cFileSpec pattern; otherwise, FALSE.
Remarks Examples
This example illustrates how File() attempts to find files:
1? File("sales.dbf")
2? File("\apps\dbf\sales.dbf")
3SetPath("\apps\dbf")
4? File("sales.dbf")
5SetPath("")
6SetDefault("\apps\dbf\")
7? File("sales.dbf")
8? File("*.dbf")
See Also