LabWindows/CVI

Table of Contents
  • LabWindows/CVI Fundamentals
  • Creating Applications
  • Distributing Applications
  • Library Reference
  • Programmer Reference
  • Hardware Information

FileExists

int FileExists (const char path[], ssize_t *fileSize);

Purpose

Determines if a file with the specified pathname exists on disk.

Parameters

Input
Name Type Description
path const char[] The pathname of a file. If it is not an absolute pathname, the pathname is relative to the current working directory.
Output
Name Type Description
fileSize ssize_t This parameter returns the size of the file in bytes if the file exists, or –1 if the file does not exist or an error occurred.

Pass 0 if you do not need this information.

Return Value

Name Type Description
result int Returns 1 (TRUE) if the file exists.

Returns 0 (FALSE) if the file was not found.

Returns a negative User Interface Library error code if an error occurred.

Possible errors:

–12 UIEOutOfMemory
–93 UIEIOError

Additional Information

Library: Programmer's Toolbox

Include file: toolbox\toolbox.h

LabWindows/CVI compatibility: LabWindows/CVI 4.0 and later

Example

Refer to userint\custctrl\progressbar\progressdemo.cws for an example of using the FileExists function.

Log in to get a better experience