in PB we have a function like this below, would need an O2 equivalent
'======================================
' check if folder exist
FUNCTION FolderExists(BYVAL FolderSpec AS STRING) EXPORT AS LONG
FUNCTION = %FALSE
IF ISTRUE PathFileExists(BYVAL STRPTR(FolderSpec)) THEN
FUNCTION = %TRUE
EXIT FUNCTION
END IF
END FUNCTION