create_pathname function