diff options
| author | Michael Albinus | 2019-02-19 14:00:17 +0100 |
|---|---|---|
| committer | Michael Albinus | 2019-02-19 14:00:17 +0100 |
| commit | 0a6c4479cff17b487580abe3a7ee202e71be25d2 (patch) | |
| tree | 8a24cd4d5742520afb9ef949da2b3f60eaf84d13 | |
| parent | e8b6cc9a99374b135a3a71dabefcdf98fe2bc6e6 (diff) | |
| download | emacs-0a6c4479cff17b487580abe3a7ee202e71be25d2.tar.gz emacs-0a6c4479cff17b487580abe3a7ee202e71be25d2.zip | |
Implement access-file in Tramp
* lisp/net/tramp-adb.el (tramp-adb-file-name-handler-alist):
* lisp/net/tramp-archive.el (tramp-archive-file-name-handler-alist):
* lisp/net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist):
* lisp/net/tramp-rclone.el (tramp-rclone-file-name-handler-alist):
* lisp/net/tramp-sh.el (tramp-sh-file-name-handler-alist)
* lisp/net/tramp-smb.el (tramp-smb-file-name-handler-alist):
* lisp/net/tramp-sudoedit.el (tramp-sudoedit-file-name-handler-alist):
Add `access-file'.
* lisp/net/tramp-archive.el (tramp-archive-handle-access-file):
* lisp/net/tramp.el (tramp-handle-access-file): New defun.
(tramp-condition-case-unless-debug): Add declaration.
(tramp-handle-insert-directory):
* lisp/net/tramp-sh.el (tramp-sh-handle-insert-directory):
* lisp/net/tramp-smb.el (tramp-smb-handle-insert-directory):
Check, whether directory is accessible.
* test/lisp/net/tramp-archive-tests.el
(tramp-archive-test17-insert-directory)
(tramp-archive-test18-file-attributes):
* test/lisp/net/tramp-tests.el (tramp-test17-insert-directory)
(tramp-test18-file-attributes): Test error cases.
| -rw-r--r-- | lisp/net/tramp-adb.el | 2 | ||||
| -rw-r--r-- | lisp/net/tramp-archive.el | 6 | ||||
| -rw-r--r-- | lisp/net/tramp-gvfs.el | 2 | ||||
| -rw-r--r-- | lisp/net/tramp-rclone.el | 2 | ||||
| -rw-r--r-- | lisp/net/tramp-sh.el | 5 | ||||
| -rw-r--r-- | lisp/net/tramp-smb.el | 5 | ||||
| -rw-r--r-- | lisp/net/tramp-sudoedit.el | 2 | ||||
| -rw-r--r-- | lisp/net/tramp.el | 11 | ||||
| -rw-r--r-- | test/lisp/net/tramp-archive-tests.el | 21 | ||||
| -rw-r--r-- | test/lisp/net/tramp-tests.el | 26 |
10 files changed, 67 insertions, 15 deletions
diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el index 4fba4e14f3a..f3ba7f2a1eb 100644 --- a/lisp/net/tramp-adb.el +++ b/lisp/net/tramp-adb.el | |||
| @@ -88,7 +88,7 @@ It is used for TCP/IP devices." | |||
| 88 | 88 | ||
| 89 | ;;;###tramp-autoload | 89 | ;;;###tramp-autoload |
| 90 | (defconst tramp-adb-file-name-handler-alist | 90 | (defconst tramp-adb-file-name-handler-alist |
| 91 | '((access-file . ignore) | 91 | '((access-file . tramp-handle-access-file) |
| 92 | (add-name-to-file . tramp-handle-add-name-to-file) | 92 | (add-name-to-file . tramp-handle-add-name-to-file) |
| 93 | ;; `byte-compiler-base-file-name' performed by default handler. | 93 | ;; `byte-compiler-base-file-name' performed by default handler. |
| 94 | ;; `copy-directory' performed by default handler. | 94 | ;; `copy-directory' performed by default handler. |
diff --git a/lisp/net/tramp-archive.el b/lisp/net/tramp-archive.el index f975ccfcfa8..db9aec05c20 100644 --- a/lisp/net/tramp-archive.el +++ b/lisp/net/tramp-archive.el | |||
| @@ -209,7 +209,7 @@ It must be supported by libarchive(3).") | |||
| 209 | ;; New handlers should be added here. | 209 | ;; New handlers should be added here. |
| 210 | ;;;###tramp-autoload | 210 | ;;;###tramp-autoload |
| 211 | (defconst tramp-archive-file-name-handler-alist | 211 | (defconst tramp-archive-file-name-handler-alist |
| 212 | '((access-file . ignore) | 212 | '((access-file . tramp-archive-handle-access-file) |
| 213 | (add-name-to-file . tramp-archive-handle-not-implemented) | 213 | (add-name-to-file . tramp-archive-handle-not-implemented) |
| 214 | ;; `byte-compiler-base-file-name' performed by default handler. | 214 | ;; `byte-compiler-base-file-name' performed by default handler. |
| 215 | ;; `copy-directory' performed by default handler. | 215 | ;; `copy-directory' performed by default handler. |
| @@ -531,6 +531,10 @@ offered." | |||
| 531 | 531 | ||
| 532 | ;; File name primitives. | 532 | ;; File name primitives. |
| 533 | 533 | ||
| 534 | (defun tramp-archive-handle-access-file (filename string) | ||
| 535 | "Like `access-file' for Tramp files." | ||
| 536 | (access-file (tramp-archive-gvfs-file-name filename) string)) | ||
| 537 | |||
| 534 | (defun tramp-archive-handle-copy-file | 538 | (defun tramp-archive-handle-copy-file |
| 535 | (filename newname &optional ok-if-already-exists keep-date | 539 | (filename newname &optional ok-if-already-exists keep-date |
| 536 | preserve-uid-gid preserve-extended-attributes) | 540 | preserve-uid-gid preserve-extended-attributes) |
diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el index bc45acd3ce6..ccbb522184d 100644 --- a/lisp/net/tramp-gvfs.el +++ b/lisp/net/tramp-gvfs.el | |||
| @@ -523,7 +523,7 @@ It has been changed in GVFS 1.14.") | |||
| 523 | ;; New handlers should be added here. | 523 | ;; New handlers should be added here. |
| 524 | ;;;###tramp-autoload | 524 | ;;;###tramp-autoload |
| 525 | (defconst tramp-gvfs-file-name-handler-alist | 525 | (defconst tramp-gvfs-file-name-handler-alist |
| 526 | '((access-file . ignore) | 526 | '((access-file . tramp-handle-access-file) |
| 527 | (add-name-to-file . tramp-handle-add-name-to-file) | 527 | (add-name-to-file . tramp-handle-add-name-to-file) |
| 528 | ;; `byte-compiler-base-file-name' performed by default handler. | 528 | ;; `byte-compiler-base-file-name' performed by default handler. |
| 529 | ;; `copy-directory' performed by default handler. | 529 | ;; `copy-directory' performed by default handler. |
diff --git a/lisp/net/tramp-rclone.el b/lisp/net/tramp-rclone.el index 3a0e002bc67..698296bf550 100644 --- a/lisp/net/tramp-rclone.el +++ b/lisp/net/tramp-rclone.el | |||
| @@ -66,7 +66,7 @@ | |||
| 66 | ;; New handlers should be added here. | 66 | ;; New handlers should be added here. |
| 67 | ;;;###tramp-autoload | 67 | ;;;###tramp-autoload |
| 68 | (defconst tramp-rclone-file-name-handler-alist | 68 | (defconst tramp-rclone-file-name-handler-alist |
| 69 | '((access-file . ignore) | 69 | '((access-file . tramp-handle-access-file) |
| 70 | (add-name-to-file . tramp-handle-add-name-to-file) | 70 | (add-name-to-file . tramp-handle-add-name-to-file) |
| 71 | ;; `byte-compiler-base-file-name' performed by default handler. | 71 | ;; `byte-compiler-base-file-name' performed by default handler. |
| 72 | ;; `copy-directory' performed by default handler. | 72 | ;; `copy-directory' performed by default handler. |
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 404fae9197e..49bc9bfcfc3 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el | |||
| @@ -940,7 +940,7 @@ of command line.") | |||
| 940 | ;; New handlers should be added here. | 940 | ;; New handlers should be added here. |
| 941 | ;;;###tramp-autoload | 941 | ;;;###tramp-autoload |
| 942 | (defconst tramp-sh-file-name-handler-alist | 942 | (defconst tramp-sh-file-name-handler-alist |
| 943 | '(;; `access-file' performed by default handler. | 943 | '((access-file . tramp-handle-access-file) |
| 944 | (add-name-to-file . tramp-sh-handle-add-name-to-file) | 944 | (add-name-to-file . tramp-sh-handle-add-name-to-file) |
| 945 | ;; `byte-compiler-base-file-name' performed by default handler. | 945 | ;; `byte-compiler-base-file-name' performed by default handler. |
| 946 | (copy-directory . tramp-sh-handle-copy-directory) | 946 | (copy-directory . tramp-sh-handle-copy-directory) |
| @@ -2574,6 +2574,9 @@ The method used must be an out-of-band method." | |||
| 2574 | "Like `insert-directory' for Tramp files." | 2574 | "Like `insert-directory' for Tramp files." |
| 2575 | (setq filename (expand-file-name filename)) | 2575 | (setq filename (expand-file-name filename)) |
| 2576 | (unless switches (setq switches "")) | 2576 | (unless switches (setq switches "")) |
| 2577 | ;; Check, whether directory is accessible. | ||
| 2578 | (unless wildcard | ||
| 2579 | (access-file filename "Reading directory")) | ||
| 2577 | (with-parsed-tramp-file-name filename nil | 2580 | (with-parsed-tramp-file-name filename nil |
| 2578 | (if (and (featurep 'ls-lisp) | 2581 | (if (and (featurep 'ls-lisp) |
| 2579 | (not (symbol-value 'ls-lisp-use-insert-directory-program))) | 2582 | (not (symbol-value 'ls-lisp-use-insert-directory-program))) |
diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el index fb9073becd0..f57c76c260b 100644 --- a/lisp/net/tramp-smb.el +++ b/lisp/net/tramp-smb.el | |||
| @@ -214,7 +214,7 @@ See `tramp-actions-before-shell' for more info.") | |||
| 214 | ;; New handlers should be added here. | 214 | ;; New handlers should be added here. |
| 215 | ;;;###tramp-autoload | 215 | ;;;###tramp-autoload |
| 216 | (defconst tramp-smb-file-name-handler-alist | 216 | (defconst tramp-smb-file-name-handler-alist |
| 217 | '(;; `access-file' performed by default handler. | 217 | '((access-file . tramp-handle-access-file) |
| 218 | (add-name-to-file . tramp-smb-handle-add-name-to-file) | 218 | (add-name-to-file . tramp-smb-handle-add-name-to-file) |
| 219 | ;; `byte-compiler-base-file-name' performed by default handler. | 219 | ;; `byte-compiler-base-file-name' performed by default handler. |
| 220 | (copy-directory . tramp-smb-handle-copy-directory) | 220 | (copy-directory . tramp-smb-handle-copy-directory) |
| @@ -994,6 +994,9 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored." | |||
| 994 | ;; Called from `dired-add-entry'. | 994 | ;; Called from `dired-add-entry'. |
| 995 | (setq filename (file-name-as-directory filename)) | 995 | (setq filename (file-name-as-directory filename)) |
| 996 | (setq filename (directory-file-name filename))) | 996 | (setq filename (directory-file-name filename))) |
| 997 | ;; Check, whether directory is accessible. | ||
| 998 | (unless wildcard | ||
| 999 | (access-file filename "Reading directory")) | ||
| 997 | (with-parsed-tramp-file-name filename nil | 1000 | (with-parsed-tramp-file-name filename nil |
| 998 | (with-tramp-progress-reporter v 0 (format "Opening directory %s" filename) | 1001 | (with-tramp-progress-reporter v 0 (format "Opening directory %s" filename) |
| 999 | (save-match-data | 1002 | (save-match-data |
diff --git a/lisp/net/tramp-sudoedit.el b/lisp/net/tramp-sudoedit.el index 04b0bebabd4..60eb2125030 100644 --- a/lisp/net/tramp-sudoedit.el +++ b/lisp/net/tramp-sudoedit.el | |||
| @@ -63,7 +63,7 @@ See `tramp-actions-before-shell' for more info.") | |||
| 63 | 63 | ||
| 64 | ;;;###tramp-autoload | 64 | ;;;###tramp-autoload |
| 65 | (defconst tramp-sudoedit-file-name-handler-alist | 65 | (defconst tramp-sudoedit-file-name-handler-alist |
| 66 | '((access-file . ignore) | 66 | '((access-file . tramp-handle-access-file) |
| 67 | (add-name-to-file . tramp-sudoedit-handle-add-name-to-file) | 67 | (add-name-to-file . tramp-sudoedit-handle-add-name-to-file) |
| 68 | (byte-compiler-base-file-name . ignore) | 68 | (byte-compiler-base-file-name . ignore) |
| 69 | ;; `copy-directory' performed by default handler. | 69 | ;; `copy-directory' performed by default handler. |
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index d000bbe3d65..efe75033f77 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el | |||
| @@ -2310,6 +2310,7 @@ ARGS are the arguments OPERATION has been called with." | |||
| 2310 | (defmacro tramp-condition-case-unless-debug | 2310 | (defmacro tramp-condition-case-unless-debug |
| 2311 | (var bodyform &rest handlers) | 2311 | (var bodyform &rest handlers) |
| 2312 | "Like `condition-case-unless-debug' but `tramp-debug-on-error'." | 2312 | "Like `condition-case-unless-debug' but `tramp-debug-on-error'." |
| 2313 | (declare (debug condition-case) (indent 2)) | ||
| 2313 | `(let ((debug-on-error tramp-debug-on-error)) | 2314 | `(let ((debug-on-error tramp-debug-on-error)) |
| 2314 | (condition-case-unless-debug ,var ,bodyform ,@handlers))) | 2315 | (condition-case-unless-debug ,var ,bodyform ,@handlers))) |
| 2315 | 2316 | ||
| @@ -3060,6 +3061,13 @@ User is always nil." | |||
| 3060 | (defvar tramp-handle-write-region-hook nil | 3061 | (defvar tramp-handle-write-region-hook nil |
| 3061 | "Normal hook to be run at the end of `tramp-*-handle-write-region'.") | 3062 | "Normal hook to be run at the end of `tramp-*-handle-write-region'.") |
| 3062 | 3063 | ||
| 3064 | (defun tramp-handle-access-file (filename string) | ||
| 3065 | "Like `access-file' for Tramp files." | ||
| 3066 | (unless (file-readable-p filename) | ||
| 3067 | (tramp-error | ||
| 3068 | (tramp-dissect-file-name filename) tramp-file-missing | ||
| 3069 | "%s: No such file or directory %s" string filename))) | ||
| 3070 | |||
| 3063 | (defun tramp-handle-add-name-to-file | 3071 | (defun tramp-handle-add-name-to-file |
| 3064 | (filename newname &optional ok-if-already-exists) | 3072 | (filename newname &optional ok-if-already-exists) |
| 3065 | "Like `add-name-to-file' for Tramp files." | 3073 | "Like `add-name-to-file' for Tramp files." |
| @@ -3439,6 +3447,9 @@ User is always nil." | |||
| 3439 | (when (and (zerop (length (file-name-nondirectory filename))) | 3447 | (when (and (zerop (length (file-name-nondirectory filename))) |
| 3440 | (not full-directory-p)) | 3448 | (not full-directory-p)) |
| 3441 | (setq switches (concat switches "F"))) | 3449 | (setq switches (concat switches "F"))) |
| 3450 | ;; Check, whether directory is accessible. | ||
| 3451 | (unless wildcard | ||
| 3452 | (access-file filename "Reading directory")) | ||
| 3442 | (with-parsed-tramp-file-name (expand-file-name filename) nil | 3453 | (with-parsed-tramp-file-name (expand-file-name filename) nil |
| 3443 | (with-tramp-progress-reporter v 0 (format "Opening directory %s" filename) | 3454 | (with-tramp-progress-reporter v 0 (format "Opening directory %s" filename) |
| 3444 | (require 'ls-lisp) | 3455 | (require 'ls-lisp) |
diff --git a/test/lisp/net/tramp-archive-tests.el b/test/lisp/net/tramp-archive-tests.el index 1d9de39ae96..9f06ab1000c 100644 --- a/test/lisp/net/tramp-archive-tests.el +++ b/test/lisp/net/tramp-archive-tests.el | |||
| @@ -570,26 +570,35 @@ This checks also `file-name-as-directory', `file-name-directory', | |||
| 570 | (format | 570 | (format |
| 571 | "\\(.+ %s\\( ->.+\\)?\n\\)\\{%d\\}" | 571 | "\\(.+ %s\\( ->.+\\)?\n\\)\\{%d\\}" |
| 572 | (regexp-opt (directory-files tramp-archive-test-archive)) | 572 | (regexp-opt (directory-files tramp-archive-test-archive)) |
| 573 | (length (directory-files tramp-archive-test-archive)))))))) | 573 | (length (directory-files tramp-archive-test-archive))))))) |
| 574 | |||
| 575 | ;; Check error case. | ||
| 576 | (with-temp-buffer | ||
| 577 | (should-error | ||
| 578 | (insert-directory | ||
| 579 | (expand-file-name "baz" tramp-archive-test-archive) nil) | ||
| 580 | :type tramp-file-missing))) | ||
| 574 | 581 | ||
| 575 | ;; Cleanup. | 582 | ;; Cleanup. |
| 576 | (tramp-archive-cleanup-hash)))) | 583 | (tramp-archive-cleanup-hash)))) |
| 577 | 584 | ||
| 578 | (ert-deftest tramp-archive-test18-file-attributes () | 585 | (ert-deftest tramp-archive-test18-file-attributes () |
| 579 | "Check `file-attributes'. | 586 | "Check `file-attributes'. |
| 580 | This tests also `file-readable-p' and `file-regular-p'." | 587 | This tests also `access-file', `file-readable-p' and `file-regular-p'." |
| 581 | :tags '(:expensive-test) | 588 | :tags '(:expensive-test) |
| 582 | (skip-unless tramp-archive-enabled) | 589 | (skip-unless tramp-archive-enabled) |
| 583 | 590 | ||
| 584 | (let ((tmp-name1 (expand-file-name "foo.txt" tramp-archive-test-archive)) | 591 | (let ((tmp-name1 (expand-file-name "foo.txt" tramp-archive-test-archive)) |
| 585 | (tmp-name2 (expand-file-name "foo.lnk" tramp-archive-test-archive)) | 592 | (tmp-name2 (expand-file-name "foo.lnk" tramp-archive-test-archive)) |
| 586 | (tmp-name3 (expand-file-name "bar" tramp-archive-test-archive)) | 593 | (tmp-name3 (expand-file-name "bar" tramp-archive-test-archive)) |
| 594 | (tmp-name4 (expand-file-name "baz" tramp-archive-test-archive)) | ||
| 587 | attr) | 595 | attr) |
| 588 | (unwind-protect | 596 | (unwind-protect |
| 589 | (progn | 597 | (progn |
| 590 | (should (file-exists-p tmp-name1)) | 598 | (should (file-exists-p tmp-name1)) |
| 591 | (should (file-readable-p tmp-name1)) | 599 | (should (file-readable-p tmp-name1)) |
| 592 | (should (file-regular-p tmp-name1)) | 600 | (should (file-regular-p tmp-name1)) |
| 601 | (should-not (access-file tmp-name1 "error")) | ||
| 593 | 602 | ||
| 594 | ;; We do not test inodes and device numbers. | 603 | ;; We do not test inodes and device numbers. |
| 595 | (setq attr (file-attributes tmp-name1)) | 604 | (setq attr (file-attributes tmp-name1)) |
| @@ -622,7 +631,13 @@ This tests also `file-readable-p' and `file-regular-p'." | |||
| 622 | (should (file-readable-p tmp-name3)) | 631 | (should (file-readable-p tmp-name3)) |
| 623 | (should-not (file-regular-p tmp-name3)) | 632 | (should-not (file-regular-p tmp-name3)) |
| 624 | (setq attr (file-attributes tmp-name3)) | 633 | (setq attr (file-attributes tmp-name3)) |
| 625 | (should (eq (car attr) t))) | 634 | (should (eq (car attr) t)) |
| 635 | (should-not (access-file tmp-name3 "error")) | ||
| 636 | |||
| 637 | ;; Check error case. | ||
| 638 | (should-error | ||
| 639 | (access-file tmp-name4 "error") | ||
| 640 | :type tramp-file-missing)) | ||
| 626 | 641 | ||
| 627 | ;; Cleanup. | 642 | ;; Cleanup. |
| 628 | (tramp-archive-cleanup-hash)))) | 643 | (tramp-archive-cleanup-hash)))) |
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index 3eb424c62dc..3afe9ad557d 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el | |||
| @@ -2730,7 +2730,14 @@ This tests also `file-directory-p' and `file-accessible-directory-p'." | |||
| 2730 | (format | 2730 | (format |
| 2731 | "\\(.+ %s\\( ->.+\\)?\n\\)\\{%d\\}" | 2731 | "\\(.+ %s\\( ->.+\\)?\n\\)\\{%d\\}" |
| 2732 | (regexp-opt (directory-files tmp-name1)) | 2732 | (regexp-opt (directory-files tmp-name1)) |
| 2733 | (length (directory-files tmp-name1)))))))) | 2733 | (length (directory-files tmp-name1))))))) |
| 2734 | |||
| 2735 | ;; Check error case. We do not check for the error type, | ||
| 2736 | ;; because ls-lisp returns `file-error', and native Tramp | ||
| 2737 | ;; returns `file-missing'. | ||
| 2738 | (delete-directory tmp-name1 'recursive) | ||
| 2739 | (with-temp-buffer | ||
| 2740 | (should-error (insert-directory tmp-name1 nil)))) | ||
| 2734 | 2741 | ||
| 2735 | ;; Cleanup. | 2742 | ;; Cleanup. |
| 2736 | (ignore-errors (delete-directory tmp-name1 'recursive)))))) | 2743 | (ignore-errors (delete-directory tmp-name1 'recursive)))))) |
| @@ -2856,8 +2863,8 @@ This tests also `file-directory-p' and `file-accessible-directory-p'." | |||
| 2856 | 2863 | ||
| 2857 | (ert-deftest tramp-test18-file-attributes () | 2864 | (ert-deftest tramp-test18-file-attributes () |
| 2858 | "Check `file-attributes'. | 2865 | "Check `file-attributes'. |
| 2859 | This tests also `file-readable-p', `file-regular-p' and | 2866 | This tests also `access-file', `file-readable-p', |
| 2860 | `file-ownership-preserved-p'." | 2867 | `file-regular-p' and `file-ownership-preserved-p'." |
| 2861 | (skip-unless (tramp--test-enabled)) | 2868 | (skip-unless (tramp--test-enabled)) |
| 2862 | 2869 | ||
| 2863 | (dolist (quoted (if (tramp--test-expensive-test) '(nil t) '(nil))) | 2870 | (dolist (quoted (if (tramp--test-expensive-test) '(nil t) '(nil))) |
| @@ -2878,6 +2885,9 @@ This tests also `file-readable-p', `file-regular-p' and | |||
| 2878 | attr) | 2885 | attr) |
| 2879 | (unwind-protect | 2886 | (unwind-protect |
| 2880 | (progn | 2887 | (progn |
| 2888 | (should-error | ||
| 2889 | (access-file tmp-name1 "error") | ||
| 2890 | :type tramp-file-missing) | ||
| 2881 | ;; `file-ownership-preserved-p' should return t for | 2891 | ;; `file-ownership-preserved-p' should return t for |
| 2882 | ;; non-existing files. It is implemented only in tramp-sh.el. | 2892 | ;; non-existing files. It is implemented only in tramp-sh.el. |
| 2883 | (when (tramp--test-sh-p) | 2893 | (when (tramp--test-sh-p) |
| @@ -2886,6 +2896,7 @@ This tests also `file-readable-p', `file-regular-p' and | |||
| 2886 | (should (file-exists-p tmp-name1)) | 2896 | (should (file-exists-p tmp-name1)) |
| 2887 | (should (file-readable-p tmp-name1)) | 2897 | (should (file-readable-p tmp-name1)) |
| 2888 | (should (file-regular-p tmp-name1)) | 2898 | (should (file-regular-p tmp-name1)) |
| 2899 | (should-not (access-file tmp-name1 "error")) | ||
| 2889 | (when (tramp--test-sh-p) | 2900 | (when (tramp--test-sh-p) |
| 2890 | (should (file-ownership-preserved-p tmp-name1 'group))) | 2901 | (should (file-ownership-preserved-p tmp-name1 'group))) |
| 2891 | 2902 | ||
| @@ -2910,11 +2921,15 @@ This tests also `file-readable-p', `file-regular-p' and | |||
| 2910 | (should (stringp (nth 3 attr))) ;; Gid. | 2921 | (should (stringp (nth 3 attr))) ;; Gid. |
| 2911 | 2922 | ||
| 2912 | (tramp--test-ignore-make-symbolic-link-error | 2923 | (tramp--test-ignore-make-symbolic-link-error |
| 2924 | (should-error | ||
| 2925 | (access-file tmp-name2 "error") | ||
| 2926 | :type tramp-file-missing) | ||
| 2913 | (when (tramp--test-sh-p) | 2927 | (when (tramp--test-sh-p) |
| 2914 | (should (file-ownership-preserved-p tmp-name2 'group))) | 2928 | (should (file-ownership-preserved-p tmp-name2 'group))) |
| 2915 | (make-symbolic-link tmp-name1 tmp-name2) | 2929 | (make-symbolic-link tmp-name1 tmp-name2) |
| 2916 | (should (file-exists-p tmp-name2)) | 2930 | (should (file-exists-p tmp-name2)) |
| 2917 | (should (file-symlink-p tmp-name2)) | 2931 | (should (file-symlink-p tmp-name2)) |
| 2932 | (should-not (access-file tmp-name2 "error")) | ||
| 2918 | (when (tramp--test-sh-p) | 2933 | (when (tramp--test-sh-p) |
| 2919 | (should (file-ownership-preserved-p tmp-name2 'group))) | 2934 | (should (file-ownership-preserved-p tmp-name2 'group))) |
| 2920 | (setq attr (file-attributes tmp-name2)) | 2935 | (setq attr (file-attributes tmp-name2)) |
| @@ -2953,6 +2968,7 @@ This tests also `file-readable-p', `file-regular-p' and | |||
| 2953 | (should (file-exists-p tmp-name1)) | 2968 | (should (file-exists-p tmp-name1)) |
| 2954 | (should (file-readable-p tmp-name1)) | 2969 | (should (file-readable-p tmp-name1)) |
| 2955 | (should-not (file-regular-p tmp-name1)) | 2970 | (should-not (file-regular-p tmp-name1)) |
| 2971 | (should-not (access-file tmp-name1 "")) | ||
| 2956 | (when (tramp--test-sh-p) | 2972 | (when (tramp--test-sh-p) |
| 2957 | (should (file-ownership-preserved-p tmp-name1 'group))) | 2973 | (should (file-ownership-preserved-p tmp-name1 'group))) |
| 2958 | (setq attr (file-attributes tmp-name1)) | 2974 | (setq attr (file-attributes tmp-name1)) |
| @@ -5590,8 +5606,8 @@ Since it unloads Tramp, it shall be the last test to run." | |||
| 5590 | ;; * Fix `tramp-test06-directory-file-name' for `ftp'. | 5606 | ;; * Fix `tramp-test06-directory-file-name' for `ftp'. |
| 5591 | ;; * Investigate, why `tramp-test11-copy-file' and `tramp-test12-rename-file' | 5607 | ;; * Investigate, why `tramp-test11-copy-file' and `tramp-test12-rename-file' |
| 5592 | ;; do not work properly for `nextcloud'. | 5608 | ;; do not work properly for `nextcloud'. |
| 5593 | ;; * Fix `tramp-test29-start-file-process' on MS Windows (`process-send-eof'?). | 5609 | ;; * Fix `tramp-test29-start-file-process' and |
| 5594 | ;; * Fix `tramp-test31-interrupt-process', timeout doesn't work reliably. | 5610 | ;; `tramp-test30-make-process' on MS Windows (`process-send-eof'?). |
| 5595 | ;; * Fix Bug#16928 in `tramp-test43-asynchronous-requests'. | 5611 | ;; * Fix Bug#16928 in `tramp-test43-asynchronous-requests'. |
| 5596 | 5612 | ||
| 5597 | (provide 'tramp-tests) | 5613 | (provide 'tramp-tests) |