added a mechanism to get a path type (filename or directory).