Function: tramp-smb-handle-make-directory-internal

tramp-smb-handle-make-directory-internal is a byte-compiled function defined in tramp-smb.el.gz.

Signature

(tramp-smb-handle-make-directory-internal DIRECTORY)

Documentation

Like make-directory-internal for Tramp files.

Source Code

;; Defined in /usr/src/emacs/lisp/net/tramp-smb.el.gz
(defun tramp-smb-handle-make-directory-internal (directory)
  "Like `make-directory-internal' for Tramp files."
  (setq directory (directory-file-name (expand-file-name directory)))
  (unless (file-name-absolute-p directory)
    (setq directory (expand-file-name directory default-directory)))
  (with-parsed-tramp-file-name directory nil
    (let* ((file (tramp-smb-get-localname v)))
      (when (file-directory-p (file-name-directory directory))
	(tramp-smb-send-command
	 v
	 (if (tramp-smb-get-cifs-capabilities v)
	     (format "posix_mkdir \"%s\" %o" file (default-file-modes))
	   (format "mkdir \"%s\"" file)))
	;; We must also flush the cache of the directory, because
	;; `file-attributes' reads the values from there.
	(tramp-flush-file-properties v localname))
      (unless (file-directory-p directory)
	(tramp-error v 'file-error "Couldn't make directory %s" directory)))))