@pxref{Top, , D-Bus, dbus}.
@table @asis
+@item @option{afp}
+@cindex method afp
+@cindex afp method
+
+Access to Mac OS X volumes via the Apple Filing Protocol is offered by
+this method. The access must always be performed with a leading
+volume (share) name, like @file{@trampfn{afp, user, host, /volume}}.
+
+
+
@item @option{dav}
@cindex method dav
@cindex method davs
@vindex tramp-gvfs-methods
@defopt tramp-gvfs-methods
This custom option, a list, defines the external methods which shall
-be used with GVFS@. Per default, these are @option{dav},
-@option{davs}, @option{obex}, @option{sftp} and @option{synce}. Other
-possible values are @option{ftp} and @option{smb}.
+be used with GVFS@. Per default, these are @option{afp},
+@option{dav}, @option{davs}, @option{obex}, @option{sftp} and
+@option{synce}. Other possible values are @option{ftp} and
+@option{smb}.
@end defopt
@end ifset
(require 'custom))
;;;###tramp-autoload
-(defcustom tramp-gvfs-methods '("dav" "davs" "obex" "sftp" "synce")
+(defcustom tramp-gvfs-methods '("afp" "dav" "davs" "obex" "sftp" "synce")
"List of methods for remote files, accessed with GVFS."
:group 'tramp
- :version "23.2"
- :type '(repeat (choice (const "dav")
+ :version "25.1"
+ :type '(repeat (choice (const "afp")
+ (const "dav")
(const "davs")
(const "ftp")
(const "obex")
;; ARRAY BYTE mount_prefix
;; ARRAY
;; STRUCT mount_spec_item
-;; STRING key (server, share, type, user, host, port)
+;; STRING key (type, user, domain, host, server,
+;; share, volume, port, ssl)
;; ARRAY BYTE value
;; ARRAY BYTE default_location Since GVFS 1.5 only !!!
(unless (tramp-run-real-handler 'file-name-absolute-p (list localname))
(setq localname (concat "/" localname)))
;; We do not pass "/..".
- (if (string-equal "smb" method)
+ (if (string-match "^\\(afp\\|smb\\)$" method)
(when (string-match "^/[^/]+\\(/\\.\\./?\\)" localname)
(setq localname (replace-match "/" t t localname 1)))
(when (string-match "^/\\.\\./?" localname)
(if (re-search-forward
"unix::uid:\\s-+\\([0-9]+\\)" nil t)
(string-to-number (match-string 1)))
- (if (re-search-forward
- "owner::user:\\s-+\\(\\S-+\\)" nil t)
+ (if (and
+ (re-search-forward "owner::user:\\s-+" nil t)
+ (re-search-forward "(\\S-+\\)" (point-at-eol) t))
(match-string 1)))
(tramp-get-local-uid id-format)))
(setq res-gid
(if (re-search-forward
"unix::gid:\\s-+\\([0-9]+\\)" nil t)
(string-to-number (match-string 1)))
- (if (re-search-forward
- "owner::group:\\s-+\\(\\S-+\\)" nil t)
+ (if (and
+ (re-search-forward "owner::group:\\s-+" nil t)
+ (re-search-forward "(\\S-+\\)" (point-at-eol) t))
(match-string 1)))
(tramp-get-local-gid id-format)))
;; ... last access, modification and change time
(cadr (assoc "port" (cadr mount-spec)))))
(ssl (tramp-gvfs-dbus-byte-array-to-string
(cadr (assoc "ssl" (cadr mount-spec)))))
- (prefix (concat (tramp-gvfs-dbus-byte-array-to-string
- (car mount-spec))
- (tramp-gvfs-dbus-byte-array-to-string
- (cadr (assoc "share" (cadr mount-spec)))))))
- (when (string-match "^smb" method)
- (setq method "smb"))
+ (prefix (concat
+ (tramp-gvfs-dbus-byte-array-to-string
+ (car mount-spec))
+ (tramp-gvfs-dbus-byte-array-to-string
+ (or (cadr (assoc "share" (cadr mount-spec)))
+ (cadr (assoc "volume" (cadr mount-spec))))))))
+ (when (string-match "^\\(afp\\|smb\\)" method)
+ (setq method (match-string 1 method)))
(when (string-equal "obex" method)
(setq host (tramp-bluez-device host)))
(when (and (string-equal "dav" method) (string-equal "true" ssl))
(cadr (assoc "port" (cadr mount-spec)))))
(ssl (tramp-gvfs-dbus-byte-array-to-string
(cadr (assoc "ssl" (cadr mount-spec)))))
- (prefix (concat (tramp-gvfs-dbus-byte-array-to-string
- (car mount-spec))
- (tramp-gvfs-dbus-byte-array-to-string
- (cadr (assoc "share" (cadr mount-spec)))))))
- (when (string-match "^smb" method)
- (setq method "smb"))
+ (prefix (concat
+ (tramp-gvfs-dbus-byte-array-to-string
+ (car mount-spec))
+ (tramp-gvfs-dbus-byte-array-to-string
+ (or
+ (cadr (assoc "share" (cadr mount-spec)))
+ (cadr (assoc "volume" (cadr mount-spec))))))))
+ (when (string-match "^\\(afp\\|smb\\)" method)
+ (setq method (match-string 1 method)))
(when (string-equal "obex" method)
(setq host (tramp-bluez-device host)))
(when (and (string-equal "dav" method) (string-equal "true" ssl))
(host (tramp-file-name-real-host vec))
(port (tramp-file-name-port vec))
(localname (tramp-file-name-localname vec))
- (ssl (if (string-match "^davs" method) "true" "false"))
+ (share (when (string-match "^/?\\([^/]+\\)" localname)
+ (match-string 1 localname)))
+ (ssl (when (string-match "^davs" method) "true" "false"))
(mount-spec
`(:array
,@(cond
((string-equal "smb" method)
- (string-match "^/?\\([^/]+\\)" localname)
(list (tramp-gvfs-mount-spec-entry "type" "smb-share")
(tramp-gvfs-mount-spec-entry "server" host)
- (tramp-gvfs-mount-spec-entry
- "share" (match-string 1 localname))))
+ (tramp-gvfs-mount-spec-entry "share" share)))
((string-equal "obex" method)
(list (tramp-gvfs-mount-spec-entry "type" method)
(tramp-gvfs-mount-spec-entry
(list (tramp-gvfs-mount-spec-entry "type" "dav")
(tramp-gvfs-mount-spec-entry "host" host)
(tramp-gvfs-mount-spec-entry "ssl" ssl)))
+ ((string-equal "afp" method)
+ (list (tramp-gvfs-mount-spec-entry "type" "afp-volume")
+ (tramp-gvfs-mount-spec-entry "host" host)
+ (tramp-gvfs-mount-spec-entry "volume" share)))
(t
(list (tramp-gvfs-mount-spec-entry "type" method)
(tramp-gvfs-mount-spec-entry "host" host))))
(string-equal localname "/"))
(tramp-error vec 'file-error "Filename must contain a Windows share"))
+ (when (and (string-equal method "afp")
+ (string-equal localname "/"))
+ (tramp-error vec 'file-error "Filename must contain an AFP volume"))
+
(with-tramp-progress-reporter
vec 3
(if (zerop (length user))
;;; TODO:
-;; * Host name completion via smb-server or smb-network.
+;; * Host name completion via afp-server, smb-server or smb-network.
;; * Check how two shares of the same SMB server can be mounted in
;; parallel.
;; * Apply SDP on bluetooth devices, in order to filter out obex