1216 |
;; output. If you are hacking on this, note that you get *no* output |
;; output. If you are hacking on this, note that you get *no* output |
1217 |
;; unless this spits out a complete line, including the '\n' at the |
;; unless this spits out a complete line, including the '\n' at the |
1218 |
;; end. |
;; end. |
1219 |
(defconst tramp-perl-file-attributes (concat |
(defconst tramp-perl-file-attributes "\ |
1220 |
"$f = $ARGV[0]; |
$f = $ARGV[0]; |
1221 |
@s = lstat($f); |
@s = lstat($f); |
1222 |
if (($s[2] & 0170000) == 0120000) { $l = readlink($f); $l = \"\\\"$l\\\"\"; } |
if (($s[2] & 0170000) == 0120000) { $l = readlink($f); $l = \"\\\"$l\\\"\"; } |
1223 |
elsif (($s[2] & 0170000) == 040000) { $l = \"t\"; } |
elsif (($s[2] & 0170000) == 040000) { $l = \"t\"; } |
1224 |
else { $l = \"nil\" }; |
else { $l = \"nil\" }; |
1225 |
printf(\"(%s %u %u %u (%u %u) (%u %u) (%u %u) %u %u t (%u . %u) (%u %u))\\n\", |
printf(\"(%s %u %d %d (%u %u) (%u %u) (%u %u) %u %u t (%u . %u) (%u %u))\\n\", |
1226 |
$l, $s[3], $s[4], $s[5], $s[8] >> 16 & 0xffff, $s[8] & 0xffff, |
$l, $s[3], $s[4], $s[5], $s[8] >> 16 & 0xffff, $s[8] & 0xffff, |
1227 |
$s[9] >> 16 & 0xffff, $s[9] & 0xffff, $s[10] >> 16 & 0xffff, $s[10] & 0xffff, |
$s[9] >> 16 & 0xffff, $s[9] & 0xffff, $s[10] >> 16 & 0xffff, $s[10] & 0xffff, |
1228 |
$s[7], $s[2], $s[1] >> 16 & 0xffff, $s[1] & 0xffff, $s[0] >> 16 & 0xffff, $s[0] & 0xffff);" |
$s[7], $s[2], $s[1] >> 16 & 0xffff, $s[1] & 0xffff, $s[0] >> 16 & 0xffff, $s[0] & 0xffff);" |
|
) |
|
1229 |
"Perl script to produce output suitable for use with `file-attributes' |
"Perl script to produce output suitable for use with `file-attributes' |
1230 |
on the remote file system.") |
on the remote file system.") |
1231 |
|
|
3188 |
|
|
3189 |
(defun tramp-invoke-ange-ftp (operation &rest args) |
(defun tramp-invoke-ange-ftp (operation &rest args) |
3190 |
"Invoke the Ange-FTP handler function and throw." |
"Invoke the Ange-FTP handler function and throw." |
3191 |
(or ange-ftp-name-format (require 'ange-ftp)) |
(or (boundp 'ange-ftp-name-format) (require 'ange-ftp)) |
3192 |
(let ((ange-ftp-name-format |
(let ((ange-ftp-name-format |
3193 |
(list (nth 0 tramp-file-name-structure) |
(list (nth 0 tramp-file-name-structure) |
3194 |
(nth 3 tramp-file-name-structure) |
(nth 3 tramp-file-name-structure) |
3195 |
(nth 2 tramp-file-name-structure) |
(nth 2 tramp-file-name-structure) |
3196 |
(nth 4 tramp-file-name-structure)))) |
(nth 4 tramp-file-name-structure)))) |
3197 |
(throw 'tramp-forward-to-ange-ftp |
(throw 'tramp-forward-to-ange-ftp |
3198 |
(apply 'ange-ftp-hook-function operation args)))) |
(tramp-run-real-handler 'ange-ftp-hook-function |
3199 |
|
(cons operation args))))) |
3200 |
|
|
3201 |
(defun tramp-ange-ftp-file-name-p (multi-method method) |
(defun tramp-ange-ftp-file-name-p (multi-method method) |
3202 |
"Check if it's a filename that should be forwarded to Ange-FTP." |
"Check if it's a filename that should be forwarded to Ange-FTP." |
3470 |
;; `/usr/bin/test'. |
;; `/usr/bin/test'. |
3471 |
;; `/usr/bin/test -e' In case `/bin/test' does not exist. |
;; `/usr/bin/test -e' In case `/bin/test' does not exist. |
3472 |
(unless (or |
(unless (or |
|
(and (setq tramp-file-exists-command "ls -d %s") |
|
|
(tramp-handle-file-exists-p existing) |
|
|
(not (tramp-handle-file-exists-p nonexisting))) |
|
3473 |
(and (setq tramp-file-exists-command "test -e %s") |
(and (setq tramp-file-exists-command "test -e %s") |
3474 |
(tramp-handle-file-exists-p existing) |
(tramp-handle-file-exists-p existing) |
3475 |
(not (tramp-handle-file-exists-p nonexisting))) |
(not (tramp-handle-file-exists-p nonexisting))) |
3478 |
(not (tramp-handle-file-exists-p nonexisting))) |
(not (tramp-handle-file-exists-p nonexisting))) |
3479 |
(and (setq tramp-file-exists-command "/usr/bin/test -e %s") |
(and (setq tramp-file-exists-command "/usr/bin/test -e %s") |
3480 |
(tramp-handle-file-exists-p existing) |
(tramp-handle-file-exists-p existing) |
3481 |
|
(not (tramp-handle-file-exists-p nonexisting))) |
3482 |
|
(and (setq tramp-file-exists-command "ls -d %s") |
3483 |
|
(tramp-handle-file-exists-p existing) |
3484 |
(not (tramp-handle-file-exists-p nonexisting)))) |
(not (tramp-handle-file-exists-p nonexisting)))) |
3485 |
(error "Couldn't find command to check if file exists.")))) |
(error "Couldn't find command to check if file exists.")))) |
3486 |
|
|
4456 |
;; |
;; |
4457 |
;; Daniel Pittman <daniel@danann.net> |
;; Daniel Pittman <daniel@danann.net> |
4458 |
(sleep-for 1) |
(sleep-for 1) |
4459 |
|
(erase-buffer) |
4460 |
(tramp-find-file-exists-command multi-method method user host) |
(tramp-find-file-exists-command multi-method method user host) |
4461 |
(make-local-variable 'tramp-ls-command) |
(make-local-variable 'tramp-ls-command) |
4462 |
(setq tramp-ls-command (tramp-find-ls-command multi-method method user host)) |
(setq tramp-ls-command (tramp-find-ls-command multi-method method user host)) |