/*[^/]*/*$
. If
the result is empty it binds Directory to /
if the first character of File is /
and .
otherwise. The behaviour is consistent
with the POSIX dirname program.155Before
SWI-Prolog 7.7.13 trailing /
where not
removed, translation /a/b/
into /a/b
. Volker
Wysk pointed at this incorrect behaviour.
See also directory_file_path/3
from library(filesex)
. The system ensures that for every
valid Path using the Prolog (POSIX) directory separators,
following is true on systems with a sound implementation of
same_file/2.156On
some systems, Path and Path2 refer to the same
entry in the file system, but same_file/2
may fail. See also prolog_to_os_filename/2.
..., file_directory_name(FilePath, Dir), file_base_name(FilePath, File), directory_file_path(Dir, File, Path2), same_file(FilePath, Path2).