(let ((par (expand-file-name ".." dir)))
(unless (file-directory-p par)
(make-directory par parents))))
- (tramp-adb-barf-unless-okay
- v (format "mkdir %s" (tramp-shell-quote-argument localname))
- "Couldn't make directory %s" dir)
(tramp-flush-file-property v (file-name-directory localname))
- (tramp-flush-directory-property v localname)))
+ (tramp-flush-directory-property v localname)
+ (unless (or (tramp-adb-send-command-and-check
+ v (format "mkdir %s" (tramp-shell-quote-argument localname)))
+ (and parents (file-directory-p dir)))
+ (tramp-error v 'file-error "Couldn't make directory %s" dir))))
(defun tramp-adb-handle-delete-directory (directory &optional recursive _trash)
"Like `delete-directory' for Tramp files."
(when (and parents (not (file-directory-p ldir)))
(make-directory ldir parents))
;; Just do it.
- (unless (tramp-gvfs-send-command
- v "gvfs-mkdir" (tramp-gvfs-url-file-name dir))
+ (unless (or (tramp-gvfs-send-command
+ v "gvfs-mkdir" (tramp-gvfs-url-file-name dir))
+ (and parents (file-directory-p dir)))
(tramp-error v 'file-error "Couldn't make directory %s" dir))))))
(defun tramp-gvfs-handle-rename-file
(should-error (make-directory tmp-name2) :type 'file-error)
(make-directory tmp-name2 'parents)
(should (file-directory-p tmp-name2))
- (should (file-accessible-directory-p tmp-name2)))
+ (should (file-accessible-directory-p tmp-name2))
+ ;; If PARENTS is non-nil, `make-directory' shall not
+ ;; signal an error when DIR exists already.
+ (make-directory tmp-name2 'parents))
;; Cleanup.
(ignore-errors (delete-directory tmp-name1 'recursive))))))