resolve pathname to string