It would appear that you need to forgo the \ when using the FILES paths and filter, if your adding further paths to the filter.
LBB is strict when it means path$, that is all you can use. filter$ can only be the filename. LB is more forgiving and allows you to add path information to the filter area.
LBB is doing exactly what it says it will. path$ is the path$ and filter$ is the filter$.
See example below.
Code: Select all
'LBB helpfile
'FILES path$, [filter$,] array$()
'Fills array$() with a list of files and directories at path$, optionally specifying a filter (e.g. "*.bas").
DIM info(0,0)
PRINT DefaultDir$ + "\F1\F2\file.txt"
IF fileExists(DefaultDir$, "\F1\F2\file.txt") < 1 then
NOTICE "Warning!" + chr$(13)+"file not found 1st try"
END IF
IF fileExists("", "\F1\F2\file.txt") < 1 then
NOTICE "Warning!" + chr$(13)+"file not found 2nd try"
END IF
IF fileExists(DefaultDir$, "F1\F2\file.txt") < 1 then
NOTICE "Warning!" + chr$(13)+"file not found 3rd try"
END IF
IF fileExists(DefaultDir$ + "\F1\F2\", "file.txt") < 1 then
NOTICE "Warning!" + chr$(13)+"file not found 4th try"
END IF
END
FUNCTION fileExists(path$, filename$)
FILES path$, filename$, info$()
fileExists = val(info$(0, 0)) 'non zero is true
PRINT path$ + filename$, "Exists:"; fileExists
END FUNCTION
'include lb45func.bas