Note that the file name returned by path->file-name may actually be the name of a directory, if the path denotes a directory.
If the last part of the path denotes a relative directory or the current directory (e.g. ".." or ".") then #f will be returned. Use simplify-path to ensure a file name does exist.