You shouldn't do this if it isn't immediately needed, and probably is less expensive checking the pathname first?