dash.assert.fileExists
Throw error if a file does not exist
Syntax
Description
Checks if a file exists. If not, throws an error. If so, returns the absolute path to the file as a string.
Also checks for files with the given extension.
Uses a custom header in thrown error IDs.
Input Arguments
filename
string scalar
The name of a file
ext
string scalar | empty array
Default file extension. Leave unset, or use an empty array to not check extensions.
idHeader
string scalar
Header to use in thrown error IDs. Default is “DASH:assert:fileExists”
Output Arguments
abspath
string scalar
The absolute path to the file