file-name-as-directory

file-name-as-directory is a built-in function in `C source code'.

(file-name-as-directory FILE)

Return a string representing the file name FILE interpreted as a directory.
This operation exists because a directory is also a file, but its name as
a directory is different from its name as a file.
The result can be used as the value of `default-directory'
or passed as second argument to `expand-file-name'.
For a Unix-syntax file name, just appends a slash.