Function: unhandled-file-name-directory

unhandled-file-name-directory is a function defined in fileio.c.

Signature

(unhandled-file-name-directory FILENAME)

Documentation

Return a directly usable directory name somehow associated with FILENAME.

A directly usable directory name is one that may be used without the intervention of any file name handler. If FILENAME is a directly usable file itself, return
(file-name-as-directory FILENAME).
If FILENAME refers to a file which is not accessible from a local process, then this should return nil. The call-process and start-process functions use this function to get a current directory to run processes in.

Probably introduced at or before Emacs version 25.1.

Source Code

// Defined in /usr/src/emacs/src/fileio.c
{
  Lisp_Object handler;

  /* If the file name has special constructs in it,
     call the corresponding file name handler.  */
  handler = Ffind_file_name_handler (filename, Qunhandled_file_name_directory);
  if (!NILP (handler))
    {
      Lisp_Object handled_name = call2 (handler, Qunhandled_file_name_directory,
					filename);
      return STRINGP (handled_name) ? handled_name : Qnil;
    }

  return Ffile_name_as_directory (filename);
}