There's also `(file-name-directory str)`.