FileExists
- Updated2023-02-21
- 1 minute(s) read
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:
|
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.