DECLARE EXTERNAL FUNCTION test$
DECLARE STRING s$
!directory getname s$
FILE GETNAME s$
!LET s$="/home/abc"
PRINT TEST$(s$)
END

EXTERNAL FUNCTION test$(s$)
DECLARE STRING bk$,c$
LET test$="UNKNOWN"
WHEN EXCEPTION IN
   OPEN #1:NAME s$
   CLOSE #1
   LET test$="FILE"
   EXIT FUNCTION
USE
END WHEN
ASK directory bk$
WHEN EXCEPTION IN
   SET directory s$
   ASK directory c$
   IF s$=c$ THEN LET TEST$="DIRECTORY"
USE
END WHEN
SET directory bk$
END FUNCTION

