check if file or dir in marcher function