Function: tramp-sh-handle-make-symbolic-link

tramp-sh-handle-make-symbolic-link is a byte-compiled function defined in tramp-sh.el.gz.

Signature

(tramp-sh-handle-make-symbolic-link TARGET LINKNAME &optional OK-IF-ALREADY-EXISTS)

Documentation

Like make-symbolic-link for Tramp files.

Aliases

tramp-androidsu-handle-make-symbolic-link

Source Code

;; Defined in /usr/src/emacs/lisp/net/tramp-sh.el.gz
;;; File Name Handler Functions:

(defun tramp-sh-handle-make-symbolic-link
    (target linkname &optional ok-if-already-exists)
  "Like `make-symbolic-link' for Tramp files."
  (let ((v (tramp-dissect-file-name (expand-file-name linkname))))
    (unless (tramp-get-remote-ln v)
      (tramp-error
       v 'file-error
       (concat "Making a symbolic link: "
	       "ln(1) does not exist on the remote host"))))

  (tramp-skeleton-make-symbolic-link target linkname ok-if-already-exists
    (tramp-send-command-and-check
     v (format
	"cd %s && %s -sf %s %s"
	(tramp-shell-quote-argument (file-name-directory localname))
	(tramp-get-remote-ln v)
	(tramp-shell-quote-argument target)
	;; The command could exceed PATH_MAX, so we use relative
	;; file names.
	(tramp-shell-quote-argument
         (concat "./" (file-name-nondirectory localname)))))))