utility: add ispathpresent functon to replace general usages of stat, checking for file type, and permissions