HB_FNameExists
Tests for the existence of a file or a directory
Syntax
File( <cFileSpec> ) --> lExists
Argument
<cFileSpec> : Exact file name to find
Returns
<lExists> : true (.T.) if the file exists or logical false (.F.)
Description
This function return a logical true (.T.) if the given filename <cFileSpec> exist
Note
HB_FNameExists() don’t accept wildcard characters
Example
Assuming this directory tree and files exist : C:\ | temp D + ---- + Dir1 D | doc1.docx F | test1.bat F | test1.txt F + Dir2 D doc2.docx F test2.bat F test2.txt F ? HB_FNameExists( 'C:\' ) // .T. ? HB_FNameExists( 'C:\*.*' ) // .F. ? HB_FNameExists( 'C:\temp\*.*' ) // .F. ? HB_FNameExists( 'C:\temp\*.' ) // .F. ? HB_FNameExists( 'C:\temp\test*.*' ) // .F. ? HB_FNameExists( 'C:\temp\test.bat' ) // .T. ? HB_FNameExists( 'C:\temp\Dir' ) // .F. ? HB_FNameExists( 'C:\temp\Dir*.*' ) // .F. ? HB_FNameExists( 'C:\temp\Dir1' ) // .T. ? HB_FNameExists( 'C:\temp\Dir1*' ) // .F. ? HB_FNameExists( 'C:\temp\Dir2' ) // .T. ? HB_FNameExists( 'C:\temp\Dir2*' ) // .F. ? HB_FNameExists( 'C:\temp\Dir1\test1.*' ) // .F. ? HB_FNameExists( 'C:\temp\Dir1\test1.bat' ) // .T. ? HB_FNameExists( 'C:\temp\Dir1\*.bat' ) // .F.
File
Library is rtl
Seealso:
SET DEFAULT, SET PATH, SET(), Directory(), File(), IsDirectory(), IsDir(), HB_FileExists(), HB_DirExists()