Function: tramp-smb-get-cifs-capabilities

tramp-smb-get-cifs-capabilities is a byte-compiled function defined in tramp-smb.el.gz.

Signature

(tramp-smb-get-cifs-capabilities VEC)

Documentation

Check whether the SMB server supports POSIX commands.

Source Code

;; Defined in /usr/src/emacs/lisp/net/tramp-smb.el.gz
(defun tramp-smb-get-cifs-capabilities (vec)
  "Check whether the SMB server supports POSIX commands."
  ;; When we are not logged in yet, we return nil.  The
  ;; connection-local property "posix" is not set explicitly; it is
  ;; just checked in order to let a user configure it to nil on hosts
  ;; which return cifs properties, but lack a proper implementation.
  ;; Very old Samba implementations, for example.
  (if (and (process-live-p (tramp-get-connection-process vec))
	   (tramp-get-connection-property vec "posix" t))
      (with-tramp-connection-property
	  (tramp-get-process vec) "cifs-capabilities"
	(save-match-data
	  (when (tramp-smb-send-command vec "posix")
	    (with-current-buffer (tramp-get-connection-buffer vec)
	      (goto-char (point-min))
	      (when
		  (re-search-forward "Server supports CIFS capabilities" nil t)
		(member
		 "pathnames"
		 (split-string
		  (buffer-substring (point) (line-end-position))
		  nil 'omit)))))))))