os.Path.isdirectory() is used to check whether a file is a directory or not:
CALL os.Path.isdirectory(f_name) RETURNING result
where
os.Path.isDirectory() returns FALSE if specified path is a symbolic link.
When you specify a file name, be careful with its case.
UNIX is case-sensitive, so it will treat files which names come in different cases as separate files.