]> code.delx.au - gnu-emacs/blobdiff - lisp/net/tramp-smb.el
-
[gnu-emacs] / lisp / net / tramp-smb.el
index 509e2e388b8915f17ef112975e1f7ee328157fc0..c4dde050c8338a76817cf0995dd64b66b6d1c9d2 100644 (file)
@@ -224,7 +224,6 @@ See `tramp-actions-before-shell' for more info.")
     (directory-files . tramp-smb-handle-directory-files)
     (directory-files-and-attributes
      . tramp-handle-directory-files-and-attributes)
-    (dired-call-process . ignore)
     (dired-compress-file . ignore)
     (dired-uncache . tramp-handle-dired-uncache)
     (expand-file-name . tramp-smb-handle-expand-file-name)
@@ -276,7 +275,7 @@ See `tramp-actions-before-shell' for more info.")
     (shell-command . tramp-handle-shell-command)
     (start-file-process . tramp-smb-handle-start-file-process)
     (substitute-in-file-name . tramp-smb-handle-substitute-in-file-name)
-    (unhandled-file-name-directory . tramp-handle-unhandled-file-name-directory)
+    (unhandled-file-name-directory . ignore)
     (vc-registered . ignore)
     (verify-visited-file-modtime . tramp-handle-verify-visited-file-modtime)
     (write-region . tramp-smb-handle-write-region))
@@ -419,12 +418,11 @@ pass to the OPERATION."
              (unwind-protect
                  (progn
                    (make-directory tmpdir)
-                   (tramp-compat-copy-directory
-                    dirname tmpdir keep-date 'parents)
-                   (tramp-compat-copy-directory
+                   (copy-directory dirname tmpdir keep-date 'parents)
+                   (copy-directory
                     (expand-file-name (file-name-nondirectory dirname) tmpdir)
                     newname keep-date parents))
-               (tramp-compat-delete-directory tmpdir 'recursive))))
+               (delete-directory tmpdir 'recursive))))
 
           ;; We can copy recursively.
           ((or t1 t2)
@@ -448,7 +446,7 @@ pass to the OPERATION."
                   (port      (tramp-file-name-port v))
                   (share     (tramp-smb-get-share v))
                   (localname (file-name-as-directory
-                              (tramp-compat-replace-regexp-in-string
+                              (replace-regexp-in-string
                                "\\\\" "/" (tramp-smb-get-localname v))))
                   (tmpdir    (make-temp-name
                               (expand-file-name
@@ -510,7 +508,7 @@ pass to the OPERATION."
                      (tramp-message
                       v 6 "%s" (mapconcat 'identity (process-command p) " "))
                      (tramp-set-connection-property p "vector" v)
-                     (tramp-compat-set-process-query-on-exit-flag p nil)
+                     (set-process-query-on-exit-flag p nil)
                      (tramp-process-actions p v nil tramp-smb-actions-with-tar)
 
                      (while (memq (process-status p) '(run open))
@@ -520,7 +518,7 @@ pass to the OPERATION."
                ;; Reset the transfer process properties.
                (tramp-set-connection-property v "process-name" nil)
                (tramp-set-connection-property v "process-buffer" nil)
-               (when t1 (tramp-compat-delete-directory tmpdir 'recurse))))
+               (when t1 (delete-directory tmpdir 'recurse))))
 
            ;; Handle KEEP-DATE argument.
            (when keep-date
@@ -555,7 +553,8 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored."
       0 (format "Copying %s to %s" filename newname)
 
     (if (file-directory-p filename)
-       (tramp-compat-copy-directory filename newname keep-date t t)
+       (tramp-compat-copy-directory
+        filename newname keep-date 'parents 'copy-contents)
 
       (let ((tmpfile (file-local-copy filename)))
        (if tmpfile
@@ -601,7 +600,7 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored."
        (mapc
         (lambda (file)
           (if (file-directory-p file)
-              (tramp-compat-delete-directory file recursive)
+              (delete-directory file recursive)
             (delete-file file)))
         ;; We do not want to delete "." and "..".
         (directory-files
@@ -665,7 +664,7 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored."
     ;; Sort them if necessary.
     (unless nosort (setq result (sort result 'string-lessp)))
     ;; Remove double entries.
-    (tramp-compat-delete-dups result)))
+    (delete-dups result)))
 
 (defun tramp-smb-handle-expand-file-name (name &optional dir)
   "Like `expand-file-name' for Tramp files."
@@ -730,7 +729,7 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored."
               (domain    (tramp-file-name-domain v))
               (port      (tramp-file-name-port v))
               (share     (tramp-smb-get-share v))
-              (localname (tramp-compat-replace-regexp-in-string
+              (localname (replace-regexp-in-string
                           "\\\\" "/" (tramp-smb-get-localname v)))
               (args      (list (concat "//" real-host "/" share) "-E")))
 
@@ -765,11 +764,10 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored."
                  (tramp-message
                   v 6 "%s" (mapconcat 'identity (process-command p) " "))
                  (tramp-set-connection-property p "vector" v)
-                 (tramp-compat-set-process-query-on-exit-flag p nil)
+                 (set-process-query-on-exit-flag p nil)
                  (tramp-process-actions p v nil tramp-smb-actions-get-acl)
                  (when (> (point-max) (point-min))
-                   (tramp-compat-funcall
-                    'substring-no-properties (buffer-string)))))
+                   (substring-no-properties (buffer-string)))))
 
            ;; Reset the transfer process properties.
            (tramp-set-connection-property v "process-name" nil)
@@ -1068,9 +1066,7 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored."
          (tramp-smb-send-command
           v
           (if (tramp-smb-get-cifs-capabilities v)
-              (format
-               "posix_mkdir \"%s\" %s"
-               file (tramp-compat-decimal-to-octal (default-file-modes)))
+              (format "posix_mkdir \"%s\" %o" file (default-file-modes))
             (format "mkdir \"%s\"" file)))
          ;; We must also flush the cache of the directory, because
          ;; `file-attributes' reads the values from there.
@@ -1240,12 +1236,7 @@ target of the symlink differ."
       (unless outbuf
        (kill-buffer (tramp-get-connection-property v "process-buffer" nil)))
 
-      ;; `process-file-side-effects' has been introduced with GNU
-      ;; Emacs 23.2.  If set to nil, no remote file will be changed
-      ;; by `program'.  If it doesn't exist, we assume its default
-      ;; value t.
-      (unless (and (boundp 'process-file-side-effects)
-                  (not (symbol-value 'process-file-side-effects)))
+      (unless process-file-side-effects
        (tramp-flush-directory-property v ""))
 
       ;; Return exit status.
@@ -1296,9 +1287,10 @@ target of the symlink differ."
              (tramp-error v2 'file-error "Cannot rename `%s'" filename))))
 
       ;; We must rename via copy.
-      (tramp-compat-copy-file filename newname ok-if-already-exists t t t)
+      (copy-file
+       filename newname ok-if-already-exists 'keep-time 'preserve-uid-gid)
       (if (file-directory-p filename)
-         (tramp-compat-delete-directory filename 'recursive)
+         (delete-directory filename 'recursive)
        (delete-file filename)))))
 
 (defun tramp-smb-action-set-acl (proc vec)
@@ -1325,10 +1317,10 @@ target of the symlink differ."
               (domain    (tramp-file-name-domain v))
               (port      (tramp-file-name-port v))
               (share     (tramp-smb-get-share v))
-              (localname (tramp-compat-replace-regexp-in-string
+              (localname (replace-regexp-in-string
                           "\\\\" "/" (tramp-smb-get-localname v)))
               (args      (list (concat "//" real-host "/" share) "-E" "-S"
-                               (tramp-compat-replace-regexp-in-string
+                               (replace-regexp-in-string
                                 "\n" "," acl-string))))
 
          (if (not (zerop (length real-user)))
@@ -1364,7 +1356,7 @@ target of the symlink differ."
                  (tramp-message
                   v 6 "%s" (mapconcat 'identity (process-command p) " "))
                  (tramp-set-connection-property p "vector" v)
-                 (tramp-compat-set-process-query-on-exit-flag p nil)
+                 (set-process-query-on-exit-flag p nil)
                  (tramp-process-actions p v nil tramp-smb-actions-set-acl)
                  (goto-char (point-max))
                  (unless (re-search-backward "tramp_exit_status [0-9]+" nil t)
@@ -1387,9 +1379,7 @@ target of the symlink differ."
     (when (tramp-smb-get-cifs-capabilities v)
       (tramp-flush-file-property v localname)
       (unless (tramp-smb-send-command
-              v (format "chmod \"%s\" %s"
-                        (tramp-smb-get-localname v)
-                        (tramp-compat-decimal-to-octal mode)))
+              v (format "chmod \"%s\" %o" (tramp-smb-get-localname v) mode))
        (tramp-error
         v 'file-error "Error while changing file's mode %s" filename)))))
 
@@ -1460,9 +1450,7 @@ errors for shares like \"C$/\", which are common in Microsoft Windows."
   "Like `write-region' for Tramp files."
   (setq filename (expand-file-name filename))
   (with-parsed-tramp-file-name filename nil
-    ;; XEmacs takes a coding system as the seventh argument, not `confirm'.
-    (when (and (not (featurep 'xemacs))
-              confirm (file-exists-p filename))
+    (when (and confirm (file-exists-p filename))
       (unless (y-or-n-p (format "File %s exists; overwrite anyway? "
                                filename))
        (tramp-error v 'file-error "File not overwritten")))
@@ -1575,10 +1563,6 @@ Result is a list of (LOCALNAME MODE SIZE MONTH DAY TIME YEAR)."
          ;; Add directory itself.
          (push '("" "drwxrwxrwx" 0 (0 0)) res)
 
-         ;; There's a very strange error (debugged with XEmacs 21.4.14)
-         ;; If there's no short delay, it returns nil.  No idea about.
-         (when (featurep 'xemacs) (sleep-for 0.01))
-
          ;; Return entries.
          (delq nil res))))))
 
@@ -1738,7 +1722,7 @@ Result is the list (LOCALNAME MODE SIZE MTIME)."
                (member
                 "pathnames"
                 (split-string
-                 (buffer-substring (point) (point-at-eol)) nil t)))))))))
+                 (buffer-substring (point) (point-at-eol)) nil 'omit)))))))))
 
 (defun tramp-smb-get-stat-capability (vec)
   "Check, whether the SMB server supports the STAT command."
@@ -1878,7 +1862,7 @@ If ARGUMENT is non-nil, use it as argument for
              (tramp-message
               vec 6 "%s" (mapconcat 'identity (process-command p) " "))
              (tramp-set-connection-property p "vector" vec)
-             (tramp-compat-set-process-query-on-exit-flag p nil)
+             (set-process-query-on-exit-flag p nil)
 
              ;; Set variables for computing the prompt for reading password.
              (setq tramp-current-method tramp-smb-method