Only chop off the end if its a file