Function: tramp-adb-handle-make-directory

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

Signature

(tramp-adb-handle-make-directory DIR &optional PARENTS)

Documentation

Like make-directory for Tramp files.

Source Code

;; Defined in /usr/src/emacs/lisp/net/tramp-adb.el.gz
(defun tramp-adb-handle-make-directory (dir &optional parents)
  "Like `make-directory' for Tramp files."
  (setq dir (expand-file-name dir))
  (with-parsed-tramp-file-name dir nil
    (when (and (null parents) (file-exists-p dir))
      (tramp-error v 'file-already-exists dir))
    (when parents
      (let ((par (expand-file-name ".." dir)))
	(unless (file-directory-p par)
	  (make-directory par parents))))
    (tramp-flush-directory-properties v localname)
    (unless (or (tramp-adb-send-command-and-check
		 v (format "mkdir -m %#o %s"
			   (default-file-modes)
			   (tramp-shell-quote-argument localname)))
		(and parents (file-directory-p dir)))
      (tramp-error v 'file-error "Couldn't make directory %s" dir))))