IsFileReadable
Checks if the given filepath is a valid and existing file path. If ignoreExtension is true, then the dir + basepath is checked for existence ignoring the extension. In the return the first return value is the actual path that exists (with the extension), second argument is the file info and finally the error
def IsFileReadable(
fpath: string,
ignoreExtension: bool
) - > string, os.FileInfo, error
Checks if the given filepath is a valid and existing file path. If ignoreExtension is true, then the dir + basepath is checked for existence ignoring the extension.
Parameters
| Name | Type | Description |
|---|---|---|
| fpath | string | The file path to check for readability and existence. |
| ignoreExtension | bool | A boolean indicating whether to ignore the file extension when checking for existence. If true, the function will look for any file matching the base path regardless of its extension. |
Returns
| Type | Description |
|---|---|
string, os.FileInfo, error | The actual path that exists (with the extension), the file information, and an error if the file is not found or unreadable. |