docs

Home All functions Categories

vuFileExists(pFile)

vuFileExists(*CSTRING), LONG

Description

Checks whether a specified file exists on disk.

Parameters

Parameter Data Type Description
pFile CSTRING(260) Full path of the file to check (for example, C:\Windows\Notepad.exe).

Note: In vuFileTools V5, CSTRINGs are not limited to the size shown above. The number is for example only.

Returns

Example

TestPath CSTRING(260)
Result   LONG

  CODE
  TestPath = 'C:\Windows\Notepad.exe'
  Result = vuFileExists(TestPath)

  IF Result
    MESSAGE('The file EXISTS: ' & TestPath, 'vuFileExists')
  ELSE
    MESSAGE('The file does NOT exist: ' & TestPath, 'vuFileExists')
  END

  TestPath = 'C:\Windows\NotNotepad.exe'
  Result = vuFileExists(TestPath)

  IF Result
    MESSAGE('The file EXISTS: ' & TestPath, 'vuFileExists')
  ELSE
    MESSAGE('The file does NOT exist: ' & TestPath, 'vuFileExists')
  END

Notes

Use vuFileExistsEx if you need to wait or poll for the file to appear.

Works with local and network paths.

Home All functions Categories