unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#30533: 26.0.60; (copy-file) over TRAMP FTP mistakes file for directory
@ 2018-02-19  8:18 Christian Johansson
  2018-02-19 17:50 ` Glenn Morris
  2018-02-20 15:06 ` Michael Albinus
  0 siblings, 2 replies; 12+ messages in thread
From: Christian Johansson @ 2018-02-19  8:18 UTC (permalink / raw)
  To: 30533


I have a case where Emacs have trouble understanding whether a remote
file is a file or a directory, I run this code where PATH-LOCAL is on
localhost and PATH-REMOTE is on a remote FTP via TRAMP

(let ((file-or-directory (not (file-directory-p path-remote))))
    (if file-or-directory
        (progn
          (message "Downloading file '%s' to '%s'.. (synchronously)" path-remote path-local)
          (copy-file path-remote path-local t t t t)
          (message "Download of file '%s' finished. (synchronously)" path-local))
      (progn
        (message "Downloading directory '%s' to '%s'.. (synchronously)" path-remote path-local)
        (copy-directory path-remote path-local t t t)
        (message "Download of directory '%s' finished. (synchronously)"
    path-local))))

The file .error-log will be transferred locally to .error-log/.error-log
instead of .error-log. The filename does not matter.

It seems (file-regular-p) mistakes remote files over TRAMP FTP more
often than (file-directory-p). Maybe that is the cause of this problem.



In GNU Emacs 26.0.60 (build 13, x86_64-apple-darwin17.3.0, NS appkit-1561.20 Version 10.13.2 (Build 17C205))
 of 2018-02-19 built on Christians-iMac
Repository revision: 020734c0e1a7ed8534df29992ffc4228d3663d89
Windowing system distributor 'Apple', version 10.3.1561
Recent messages:
Getting /ftp:ftpuser@ftphost:/remotepath/style.css...done
Getting /ftp:ftpuser@ftphost:/remotepath/travel-tips.php...done
Differences calculated between directory ’/localpath/’ and ’/ftp:ftpuser@ftphost:/remotepath/’ -> 0 only in A, 2 only in B, 0 differs. (synchronously)
previous-line: Beginning of buffer [6 times]
Downloading file ’/ftp:ftpuser@ftphost:/remotepath/.error-log’ to ’/localpath/.error-log’.. (synchronously)
> ftp:ftpuser@ftphost:/remotepath/.error-log to /localpath/.error-log/...
> p:ftpuser@ftphost:/remotepath/.error-log to /localpath/.error-log/...5k
> :ftpuser@ftphost:/remotepath/.error-log to /localpath/.error-log/...21k
> ftpuser@ftphost:/remotepath/.error-log to /localpath/.error-log/...done
Download of file ’/localpath/.error-log’ finished. (synchronously)
Quit [2 times]
Configured features:
JPEG RSVG NOTIFY ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS NS LCMS2

Important settings:
  value of $LANG: sv_SE.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Messages

Minor modes in effect:
  show-paren-mode: t
  save-place-mode: t
  helm-mode: t
  helm-autoresize-mode: t
  global-flycheck-mode: t
  global-hl-todo-mode: t
  global-diff-hl-mode: t
  diff-auto-refine-mode: t
  global-auto-complete-mode: t
  dired-async-mode: t
  editorconfig-mode: t
  yas-global-mode: t
  yas-minor-mode: t
  override-global-mode: t
  ido-everywhere: t
  display-time-mode: t
  winner-mode: t
  electric-pair-mode: t
  desktop-save-mode: t
  global-semantic-mru-bookmark-mode: t
  global-semanticdb-minor-mode: t
  global-semantic-idle-completions-mode: t
  global-semantic-idle-scheduler-mode: t
  global-semantic-idle-local-symbol-highlight-mode: t
  global-semantic-idle-summary-mode: t
  global-semantic-decoration-mode: t
  global-semantic-highlight-func-mode: t
  global-semantic-stickyfunc-mode: t
  semantic-mode: t
  global-ede-mode: t
  delete-selection-mode: t
  global-whitespace-mode: t
  which-function-mode: t
  shell-dirtrack-mode: t
  cl-old-struct-compat-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  buffer-read-only: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
/Users/christianjohansson/.emacs.d/ssh-deploy/ssh-deploy hides /Users/christianjohansson/.emacs.d/elpa/ssh-deploy-20180218.704/ssh-deploy
/Users/christianjohansson/.emacs.d/ssh-deploy/ssh-deploy-diff-mode hides /Users/christianjohansson/.emacs.d/elpa/ssh-deploy-20180218.704/ssh-deploy-diff-mode
/Users/christianjohansson/.emacs.d/elpa/less-css-mode-20160930.2153/less-css-mode hides /Users/christianjohansson/Documents/remacs/lisp/textmodes/less-css-mode

Features:
(shadow sort mail-extr ediff-merg ediff-wind ediff-diff ediff-mult
ediff-help ediff-init ediff-util tramp-cache conf-mode ange-ftp
tramp-ftp ede/dired helm-semantic helm-imenu vc-git emacsbug message
puny rfc822 mml mml-sec epa derived epg gnus-util rmail rmail-loaddefs
mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils
mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr
mail-utils helm-command helm-elisp helm-eval edebug helm-info
display-line-numbers rainbow-mode color flycheck-rust
flycheck-color-mode-line face-remap auto-package-update ts-comint tss
log4e json-mode json-reformat json-snatcher smartparens-javascript js
smartparens-html sgml-mode dom tide tide-lv typescript-mode smarty-mode
paren saveplace restclient helm-mode helm-files helm-buffers helm-tags
helm-locate helm-grep helm-regexp helm-utils helm-help helm-types helm
helm-source helm-multi-match helm-lib flycheck-pos-tip pos-tip flycheck
subr-x hl-todo diff-hl vc-dir ewoc vc vc-dispatcher diff-mode
exec-path-from-shell ssh-deploy ssh-deploy-diff-mode ac-html
ac-html-core ztree ztree-diff ztree-diff-model ztree-dir ztree-view
ztree-util grunt hlinum linum ac-php auto-complete-config auto-complete
ac-php-core popup phpcbf php-auto-yasnippets php-mode etags xref project
add-log cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align
cc-engine cc-vars cc-defs web-beautify imenu-list reveal-in-osx-finder
auto-dictionary flyspell ispell dired-async dired-aux dired
dired-loaddefs async editorconfig server ansible-doc ecb ecb-symboldef
ecb-analyse ecb-compatibility ecb-winman-support ecb-autogen autoload
radix-tree lisp-mnt ecb-tod ecb-cycle ecb-eshell ecb-help ecb-jde
ecb-method-browser hideshow ecb-semantic-wrapper ecb-semantic
ecb-file-browser ecb-speedbar ecb-layout ecb-create-layout
ecb-compilation ecb-common-browser ecb-navigate eieio-compat
ecb-mode-line ecb-face tree-buffer ecb-upgrade ecb-cedet-wrapper
semantic/db-find semantic/db-ref semantic/analyze semantic/sort
semantic/scope semantic/analyze/fcn ecb-util flymake-rust flymake-easy
flymake rust-playground time-stamp cargo cargo-process smartparens-rust
rust-mode compile google-translate google-translate-default-ui
google-translate-core-ui google-translate-core google-translate-tk url
url-proxy url-privacy url-expand url-methods url-history url-cookie
url-domsuf url-util mailcap json map lorem-ipsum company
smartparens-config smartparens-text smartparens thingatpt paredit
ansible f yasnippet yaxception ht dash know-your-http-well
http-status-codes http-relations http-methods http-headers s hydra lv
cl-extra help-mode use-package up-delight up-diminish up-ensure up-core
pcase cl bind-key easy-mmode ido time winner edmacro kmacro elec-pair
desktop frameset semantic/mru-bookmark semantic/db-mode semantic/db
semantic/idle semantic/format semantic/ctxt semantic/decorate/mode
semantic/tag-ls semantic/find semantic/decorate pulse
semantic/util-modes semantic/util semantic semantic/tag semantic/lex
semantic/fw mode-local find-func ede/speedbar ede/files ede ede/detect
ede/base ede/auto ede/source eieio-base eieio-speedbar speedbar sb-image
ezimage dframe eieio-custom wid-edit cedet delsel disp-table whitespace
which-func imenu windmove base16-dracula-theme base16-theme tramp
tramp-compat tramp-loaddefs trampver shell pcomplete comint ansi-color
ring parse-time format-spec advice cus-start cus-load finder-inf rx info
package easymenu epg-config url-handlers url-parse auth-source cl-seq
eieio eieio-core cl-macs eieio-loaddefs password-cache url-vars seq
byte-opt gv bytecomp byte-compile cconv cl-loaddefs cl-lib time-date
tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type
mwheel term/ns-win ns-win ucs-normalize mule-util term/common-win
tool-bar dnd fontset image regexp-opt fringe tabulated-list replace
newcomment text-mode elisp-mode lisp-mode prog-mode register page
menu-bar rfn-eshadow isearch timer select scroll-bar mouse jit-lock
font-lock syntax facemenu font-core term/tty-colors frame cl-generic
cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech
european ethiopic indian cyrillic chinese composite charscript charprop
case-table epa-hook jka-cmpr-hook help simple abbrev obarray minibuffer
cl-preloaded nadvice loaddefs button faces cus-face macroexp files
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote kqueue cocoa ns lcms2
multi-tty make-network-process emacs)

Memory information:
((conses 16 601023 38540)
 (symbols 48 54999 49)
 (miscs 40 1120 809)
 (strings 32 146615 15732)
 (string-bytes 1 4761875)
 (vectors 16 82947)
 (vector-slots 8 1371207 5634)
 (floats 8 426 907)
 (intervals 56 1355 232)
 (buffers 992 24))





^ permalink raw reply	[flat|nested] 12+ messages in thread

* bug#30533: 26.0.60; (copy-file) over TRAMP FTP mistakes file for directory
  2018-02-19  8:18 bug#30533: 26.0.60; (copy-file) over TRAMP FTP mistakes file for directory Christian Johansson
@ 2018-02-19 17:50 ` Glenn Morris
  2018-02-20  5:04   ` Christian Johansson
                     ` (2 more replies)
  2018-02-20 15:06 ` Michael Albinus
  1 sibling, 3 replies; 12+ messages in thread
From: Glenn Morris @ 2018-02-19 17:50 UTC (permalink / raw)
  To: Christian Johansson; +Cc: 30533

Christian Johansson wrote:

> In GNU Emacs 26.0.60 (build 13, x86_64-apple-darwin17.3.0, NS appkit-1561.20 Version 10.13.2 (Build 17C205))
>  of 2018-02-19 built on Christians-iMac
> Repository revision: 020734c0e1a7ed8534df29992ffc4228d3663d89

26.0.60 is a rather old development version (before last October), and
furthermore the git revision doesn't seem to correspond to anything in
the Emacs repository.





^ permalink raw reply	[flat|nested] 12+ messages in thread

* bug#30533: 26.0.60; (copy-file) over TRAMP FTP mistakes file for directory
  2018-02-19 17:50 ` Glenn Morris
@ 2018-02-20  5:04   ` Christian Johansson
  2018-02-20 11:02   ` Christian Johansson
  2018-02-20 15:49   ` Christian Johansson
  2 siblings, 0 replies; 12+ messages in thread
From: Christian Johansson @ 2018-02-20  5:04 UTC (permalink / raw)
  To: 30533

Ok problem reproduced with latest trunk.

Output:

Downloading directory ’/ftp:ftpuser@ftphost.com:/remotepath/app.php’ to 
’/localpath/app.php’.. (synchronously)
tramp-file-name-handler: Opening directory: Not a directory, 
/ftp:ftpuser@ftphost.com:/remotepath/app.php

After running:

(defun ssh-deploy--download-via-tramp (path-remote path-local 
revision-folder)
   "Download PATH-REMOTE to PATH-LOCAL via TRAMP synchronously and store 
a copy in REVISION-FOLDER."
   (let ((file-or-directory (file-regular-p path-remote)))
     (if file-or-directory
         (progn
           (message "Downloading file '%s' to '%s'.. (synchronously)" 
path-remote path-local)
           (copy-file path-remote path-local t t t t)
           (ssh-deploy-store-revision path-local revision-folder)
           (message "Download of file '%s' finished. (synchronously)" 
path-local))
       (progn
         (message "Downloading directory '%s' to '%s'.. (synchronously)" 
path-remote path-local)
         (copy-directory path-remote path-local t t t)
         (message "Download of directory '%s' finished. (synchronously)"
   path-local)))))

Where variables
path-remote =
/ftp:ftpuser@ftphost.com:/remotepath/app.php
path-local = /localpath/app.php




In GNU Emacs 27.0.50 (build 1, x86_64-apple-darwin17.4.0, NS 
appkit-1561.20 Version 10.13.3 (Build 17D47))
  of 2018-02-19 built on Christians-MacBook-Air.local
Repository revision: 071a0a571243f9498e0e58e5fe938a7b892a22db
Windowing system distributor 'Apple', version 10.3.1561
System Description:  Mac OS X 10.13.3

Recent messages:
Generating differences between directory ’/localpath/’ and 
’/ftp:ftpuser@ftphost.com:/remotepath/’.. (synchronously)
Differences calculated between directory ’/localpath/’ and 
’/ftp:ftpuser@ftphost.com:/remotepath/’ -> 0 only in A, 1 only in B, 0 
differs. (synchronously)
funcall-interactively: Buffer is read-only: #<buffer ssh-deploy diff<3>> 
[3 times]
Downloading directory ’/ftp:ftpuser@ftphost.com:/remotepath/app.php’ to 
’/localpath/app.php’.. (synchronously)
tramp-file-name-handler: Opening directory: Not a directory, 
/ftp:ftpuser@ftphost.com:/remotepath/app.php
Reverting buffer ‘app.php’.

Configured features:
RSVG IMAGEMAGICK NOTIFY ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS NS
THREADS

Important settings:
   value of $LC_CTYPE: UTF-8
   value of $LANG: en_SE.UTF-8
   locale-coding-system: utf-8-unix

Major mode: SSH-Deploy-Diff

Minor modes in effect:
   flycheck-color-mode-line-mode: t
   show-paren-mode: t
   save-place-mode: t
   helm-mode: t
   helm-autoresize-mode: t
   global-flycheck-mode: t
   flycheck-mode: t
   global-hl-todo-mode: t
   global-diff-hl-mode: t
   diff-auto-refine-mode: t
   global-auto-complete-mode: t
   dired-async-mode: t
   editorconfig-mode: t
   yas-global-mode: t
   yas-minor-mode: t
   override-global-mode: t
   ido-everywhere: t
   display-time-mode: t
   winner-mode: t
   electric-pair-mode: t
   desktop-save-mode: t
   global-semantic-mru-bookmark-mode: t
   global-semanticdb-minor-mode: t
   global-semantic-idle-completions-mode: t
   global-semantic-idle-scheduler-mode: t
   global-semantic-idle-local-symbol-highlight-mode: t
   global-semantic-idle-summary-mode: t
   global-semantic-decoration-mode: t
   global-semantic-highlight-func-mode: t
   global-semantic-stickyfunc-mode: t
   semantic-mode: t
   global-ede-mode: t
   delete-selection-mode: t
   global-whitespace-mode: t
   which-function-mode: t
   shell-dirtrack-mode: t
   cl-old-struct-compat-mode: t
   tooltip-mode: t
   global-eldoc-mode: t
   electric-indent-mode: t
   mouse-wheel-mode: t
   menu-bar-mode: t
   file-name-shadow-mode: t
   global-font-lock-mode: t
   font-lock-mode: t
   blink-cursor-mode: t
   auto-composition-mode: t
   auto-encryption-mode: t
   auto-compression-mode: t
   buffer-read-only: t
   column-number-mode: t
   line-number-mode: t
   transient-mark-mode: t

Load-path shadows:
/Users/christianjohansson/.emacs.d/ssh-deploy/ssh-deploy hides 
/Users/christianjohansson/.emacs.d/elpa/ssh-deploy-20180216.736/ssh-deploy
/Users/christianjohansson/.emacs.d/ssh-deploy/ssh-deploy-diff-mode hides 
/Users/christianjohansson/.emacs.d/elpa/ssh-deploy-20180216.736/ssh-deploy-diff-mode
/Users/christianjohansson/.emacs.d/elpa/less-css-mode-20160930.2153/less-css-mode 
hides /Users/christianjohansson/Documents/emacs/lisp/textmodes/less-css-mode

Features:
(shadow sort mail-extr emacsbug sendmail helm-command helm-elisp
helm-eval edebug helm-info ediff-merg ediff-wind ediff-diff ediff-mult
ediff-help ediff-init ediff-util tramp-cache conf-mode ange-ftp
tramp-ftp eww mm-url url-queue shr svg xml browse-url ac-racer racer
semantic/bovine/c semantic/decorate/include hideif semantic/bovine/c-by
semantic/lex-spp semantic/bovine/gcc semantic/dep semantic/bovine
semantic/analyze/refs ede/dired twig-mode semantic/imenu semantic/sb
semantic/db-file data-debug cedet-files semantic/wisent/javascript-jv
semantic/wisent/js-wy semantic/wisent semantic/wisent/wisent
semantic/java semantic/doc tern url-http url-auth url-gw nsm
display-line-numbers rainbow-mode color cursor-sensor js2-mode
autorevert filenotify vc-git flycheck-rust flycheck-color-mode-line
face-remap org-rmail org-mhe org-irc org-info org-gnus nnir gnus-sum
gnus-group gnus-undo gnus-start gnus-cloud nnimap nnmail mail-source tls
gnutls utf7 netrc nnoo gnus-spec gnus-int gnus-range message rmc puny
rfc822 mml mml-sec epa derived epg mm-decode mm-bodies mm-encode
mail-parse rfc2231 mailabbrev gmm-utils mailheader gnus-win gnus
nnheader gnus-util rmail rmail-loaddefs rfc2047 rfc2045 ietf-drums
mail-utils mm-util mail-prsvr org-docview doc-view jka-compr image-mode
org-bibtex bibtex org-bbdb org-w3m editorconfig-core
editorconfig-core-handle editorconfig-fnmatch org-element avl-tree
generator smartparens-org org org-macro org-footnote org-pcomplete
org-list org-faces org-entities noutline outline org-version
ob-emacs-lisp ob ob-tangle org-src ob-ref ob-lob ob-table ob-keys ob-exp
ob-comint ob-core ob-eval org-compat org-macs org-loaddefs cal-menu
calendar cal-loaddefs auto-package-update ts-comint tss log4e json-mode
json-reformat json-snatcher smartparens-javascript js smartparens-html
sgml-mode dom tide tide-lv typescript-mode smarty-mode paren saveplace
restclient helm-mode helm-files helm-buffers helm-tags helm-locate
helm-grep helm-regexp helm-utils helm-help helm-types helm helm-source
helm-multi-match helm-lib flycheck-pos-tip pos-tip flycheck subr-x
hl-todo diff-hl vc-dir ewoc vc vc-dispatcher diff-mode
exec-path-from-shell ssh-deploy ssh-deploy-diff-mode ac-html
ac-html-core ztree ztree-diff ztree-diff-model ztree-dir ztree-view
ztree-util grunt hlinum linum ac-php auto-complete-config auto-complete
ac-php-core popup phpcbf php-auto-yasnippets php-mode cc-langs etags
xref project add-log cc-mode cc-fonts cc-guess cc-menus cc-cmds
cc-styles cc-align cc-engine cc-vars cc-defs web-beautify imenu-list
reveal-in-osx-finder auto-dictionary flyspell ispell dired-async
dired-aux dired dired-loaddefs async editorconfig server ansible-doc ecb
ecb-symboldef ecb-analyse ecb-compatibility ecb-winman-support
ecb-autogen autoload radix-tree lisp-mnt ecb-tod ecb-cycle ecb-eshell
ecb-help ecb-jde ecb-method-browser hideshow ecb-semantic-wrapper
ecb-semantic ecb-file-browser ecb-speedbar ecb-layout ecb-create-layout
ecb-compilation ecb-common-browser ecb-navigate eieio-compat
ecb-mode-line ecb-face tree-buffer ecb-upgrade ecb-cedet-wrapper
semantic/db-find semantic/db-ref semantic/analyze semantic/sort
semantic/scope semantic/analyze/fcn ecb-util flymake-rust flymake-easy
flymake-proc flymake warnings rust-playground time-stamp cargo
cargo-process smartparens-rust rust-mode compile google-translate
google-translate-default-ui google-translate-core-ui
google-translate-core google-translate-tk url url-proxy url-privacy
url-expand url-methods url-history url-cookie url-domsuf url-util
mailcap lorem-ipsum company smartparens-config smartparens-text
smartparens thingatpt paredit ansible f yasnippet yaxception ht dash
know-your-http-well http-status-codes http-relations http-methods
http-headers s hydra lv cl-extra help-mode use-package up-delight
up-diminish up-ensure up-core pcase cl bind-key easy-mmode ido time
winner edmacro kmacro elec-pair desktop frameset semantic/mru-bookmark
semantic/db-mode semantic/db semantic/idle semantic/format semantic/ctxt
semantic/decorate/mode semantic/tag-ls semantic/find semantic/decorate
pulse semantic/util-modes semantic/util semantic semantic/tag
semantic/lex semantic/fw mode-local find-func ede/speedbar ede/files ede
ede/detect ede/base ede/auto ede/source eieio-base eieio-speedbar
speedbar sb-image ezimage dframe eieio-custom wid-edit cedet delsel
disp-table whitespace which-func imenu windmove tramp trampver
tramp-compat tramp-loaddefs shell pcomplete comint ansi-color ring
parse-time format-spec advice base16-circus-theme base16-theme time-date
finder-inf rx info package easymenu epg-config url-handlers url-parse
auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs
password-cache json map url-vars seq byte-opt gv bytecomp byte-compile
cconv cl-loaddefs cl-lib tooltip eldoc electric uniquify ediff-hook
vc-hooks lisp-float-type mwheel term/ns-win ns-win ucs-normalize
mule-util term/common-win tool-bar dnd fontset image regexp-opt fringe
tabulated-list replace newcomment text-mode elisp-mode lisp-mode
prog-mode register page menu-bar rfn-eshadow isearch timer select
scroll-bar mouse jit-lock font-lock syntax facemenu font-core
term/tty-colors frame cl-generic cham georgian utf-8-lang misc-lang
vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932
hebrew greek romanian slovak czech european ethiopic indian cyrillic
chinese composite charscript charprop case-table epa-hook jka-cmpr-hook
help simple abbrev obarray minibuffer cl-preloaded nadvice loaddefs
button faces cus-face macroexp files text-properties overlay sha1 md5
base64 format env code-pages mule custom widget hashtable-print-readable
backquote kqueue cocoa ns multi-tty make-network-process emacs)

Memory information:
((conses 16 934525 73980)
  (symbols 48 70113 11)
  (miscs 40 1160 1857)
  (strings 32 197950 10494)
  (string-bytes 1 6490921)
  (vectors 16 112100)
  (vector-slots 8 2419803 161810)
  (floats 8 597 408)
  (intervals 56 44366 1236)
  (buffers 992 49))


On 2018-02-19 18:50, Glenn Morris wrote:
> Christian Johansson wrote:
>
>> In GNU Emacs 26.0.60 (build 13, x86_64-apple-darwin17.3.0, NS appkit-1561.20 Version 10.13.2 (Build 17C205))
>>   of 2018-02-19 built on Christians-iMac
>> Repository revision: 020734c0e1a7ed8534df29992ffc4228d3663d89
> 26.0.60 is a rather old development version (before last October), and
> furthermore the git revision doesn't seem to correspond to anything in
> the Emacs repository.
>
>
>






^ permalink raw reply	[flat|nested] 12+ messages in thread

* bug#30533: 26.0.60; (copy-file) over TRAMP FTP mistakes file for directory
  2018-02-19 17:50 ` Glenn Morris
  2018-02-20  5:04   ` Christian Johansson
@ 2018-02-20 11:02   ` Christian Johansson
  2018-02-20 15:49   ` Christian Johansson
  2 siblings, 0 replies; 12+ messages in thread
From: Christian Johansson @ 2018-02-20 11:02 UTC (permalink / raw)
  To: 30533

[-- Attachment #1: Type: text/plain, Size: 11035 bytes --]

Ok problem reproduced with latest trunk.

Output:

Downloading directory ’/ftp:ftpuser@ftphost.com:/remotepath/app.php’ to 
’/localpath/app.php’.. (synchronously)
tramp-file-name-handler: Opening directory: Not a directory, 
/ftp:ftpuser@ftphost.com:/remotepath/app.php

After running:

(defun ssh-deploy--download-via-tramp (path-remote path-local 
revision-folder)
   "Download PATH-REMOTE to PATH-LOCAL via TRAMP synchronously and store 
a copy in REVISION-FOLDER."
   (let ((file-or-directory (file-regular-p path-remote)))
     (if file-or-directory
         (progn
           (message "Downloading file '%s' to '%s'.. (synchronously)" 
path-remote path-local)
           (copy-file path-remote path-local t t t t)
           (ssh-deploy-store-revision path-local revision-folder)
           (message "Download of file '%s' finished. (synchronously)" 
path-local))
       (progn
         (message "Downloading directory '%s' to '%s'.. (synchronously)" 
path-remote path-local)
         (copy-directory path-remote path-local t t t)
         (message "Download of directory '%s' finished. (synchronously)"
   path-local)))))

Where variables
path-remote =
/ftp:ftpuser@ftphost.com:/remotepath/app.php
path-local = /localpath/app.php




In GNU Emacs 27.0.50 (build 1, x86_64-apple-darwin17.4.0, NS 
appkit-1561.20 Version 10.13.3 (Build 17D47))
  of 2018-02-19 built on Christians-MacBook-Air.local
Repository revision: 071a0a571243f9498e0e58e5fe938a7b892a22db
Windowing system distributor 'Apple', version 10.3.1561
System Description:  Mac OS X 10.13.3

Recent messages:
Generating differences between directory ’/localpath/’ and 
’/ftp:ftpuser@ftphost.com:/remotepath/’.. (synchronously)
Differences calculated between directory ’/localpath/’ and 
’/ftp:ftpuser@ftphost.com:/remotepath/’ -> 0 only in A, 1 only in B, 0 
differs. (synchronously)
funcall-interactively: Buffer is read-only: #<buffer ssh-deploy diff<3>> 
[3 times]
Downloading directory ’/ftp:ftpuser@ftphost.com:/remotepath/app.php’ to 
’/localpath/app.php’.. (synchronously)
tramp-file-name-handler: Opening directory: Not a directory, 
/ftp:ftpuser@ftphost.com:/remotepath/app.php
Reverting buffer ‘app.php’.

Configured features:
RSVG IMAGEMAGICK NOTIFY ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS NS
THREADS

Important settings:
   value of $LC_CTYPE: UTF-8
   value of $LANG: en_SE.UTF-8
   locale-coding-system: utf-8-unix

Major mode: SSH-Deploy-Diff

Minor modes in effect:
   flycheck-color-mode-line-mode: t
   show-paren-mode: t
   save-place-mode: t
   helm-mode: t
   helm-autoresize-mode: t
   global-flycheck-mode: t
   flycheck-mode: t
   global-hl-todo-mode: t
   global-diff-hl-mode: t
   diff-auto-refine-mode: t
   global-auto-complete-mode: t
   dired-async-mode: t
   editorconfig-mode: t
   yas-global-mode: t
   yas-minor-mode: t
   override-global-mode: t
   ido-everywhere: t
   display-time-mode: t
   winner-mode: t
   electric-pair-mode: t
   desktop-save-mode: t
   global-semantic-mru-bookmark-mode: t
   global-semanticdb-minor-mode: t
   global-semantic-idle-completions-mode: t
   global-semantic-idle-scheduler-mode: t
   global-semantic-idle-local-symbol-highlight-mode: t
   global-semantic-idle-summary-mode: t
   global-semantic-decoration-mode: t
   global-semantic-highlight-func-mode: t
   global-semantic-stickyfunc-mode: t
   semantic-mode: t
   global-ede-mode: t
   delete-selection-mode: t
   global-whitespace-mode: t
   which-function-mode: t
   shell-dirtrack-mode: t
   cl-old-struct-compat-mode: t
   tooltip-mode: t
   global-eldoc-mode: t
   electric-indent-mode: t
   mouse-wheel-mode: t
   menu-bar-mode: t
   file-name-shadow-mode: t
   global-font-lock-mode: t
   font-lock-mode: t
   blink-cursor-mode: t
   auto-composition-mode: t
   auto-encryption-mode: t
   auto-compression-mode: t
   buffer-read-only: t
   column-number-mode: t
   line-number-mode: t
   transient-mark-mode: t

Load-path shadows:
/Users/christianjohansson/.emacs.d/ssh-deploy/ssh-deploy hides 
/Users/christianjohansson/.emacs.d/elpa/ssh-deploy-20180216.736/ssh-deploy
/Users/christianjohansson/.emacs.d/ssh-deploy/ssh-deploy-diff-mode hides 
/Users/christianjohansson/.emacs.d/elpa/ssh-deploy-20180216.736/ssh-deploy-diff-mode 

/Users/christianjohansson/.emacs.d/elpa/less-css-mode-20160930.2153/less-css-mode 
hides 
/Users/christianjohansson/Documents/emacs/lisp/textmodes/less-css-mode

Features:
(shadow sort mail-extr emacsbug sendmail helm-command helm-elisp
helm-eval edebug helm-info ediff-merg ediff-wind ediff-diff ediff-mult
ediff-help ediff-init ediff-util tramp-cache conf-mode ange-ftp
tramp-ftp eww mm-url url-queue shr svg xml browse-url ac-racer racer
semantic/bovine/c semantic/decorate/include hideif semantic/bovine/c-by
semantic/lex-spp semantic/bovine/gcc semantic/dep semantic/bovine
semantic/analyze/refs ede/dired twig-mode semantic/imenu semantic/sb
semantic/db-file data-debug cedet-files semantic/wisent/javascript-jv
semantic/wisent/js-wy semantic/wisent semantic/wisent/wisent
semantic/java semantic/doc tern url-http url-auth url-gw nsm
display-line-numbers rainbow-mode color cursor-sensor js2-mode
autorevert filenotify vc-git flycheck-rust flycheck-color-mode-line
face-remap org-rmail org-mhe org-irc org-info org-gnus nnir gnus-sum
gnus-group gnus-undo gnus-start gnus-cloud nnimap nnmail mail-source tls
gnutls utf7 netrc nnoo gnus-spec gnus-int gnus-range message rmc puny
rfc822 mml mml-sec epa derived epg mm-decode mm-bodies mm-encode
mail-parse rfc2231 mailabbrev gmm-utils mailheader gnus-win gnus
nnheader gnus-util rmail rmail-loaddefs rfc2047 rfc2045 ietf-drums
mail-utils mm-util mail-prsvr org-docview doc-view jka-compr image-mode
org-bibtex bibtex org-bbdb org-w3m editorconfig-core
editorconfig-core-handle editorconfig-fnmatch org-element avl-tree
generator smartparens-org org org-macro org-footnote org-pcomplete
org-list org-faces org-entities noutline outline org-version
ob-emacs-lisp ob ob-tangle org-src ob-ref ob-lob ob-table ob-keys ob-exp
ob-comint ob-core ob-eval org-compat org-macs org-loaddefs cal-menu
calendar cal-loaddefs auto-package-update ts-comint tss log4e json-mode
json-reformat json-snatcher smartparens-javascript js smartparens-html
sgml-mode dom tide tide-lv typescript-mode smarty-mode paren saveplace
restclient helm-mode helm-files helm-buffers helm-tags helm-locate
helm-grep helm-regexp helm-utils helm-help helm-types helm helm-source
helm-multi-match helm-lib flycheck-pos-tip pos-tip flycheck subr-x
hl-todo diff-hl vc-dir ewoc vc vc-dispatcher diff-mode
exec-path-from-shell ssh-deploy ssh-deploy-diff-mode ac-html
ac-html-core ztree ztree-diff ztree-diff-model ztree-dir ztree-view
ztree-util grunt hlinum linum ac-php auto-complete-config auto-complete
ac-php-core popup phpcbf php-auto-yasnippets php-mode cc-langs etags
xref project add-log cc-mode cc-fonts cc-guess cc-menus cc-cmds
cc-styles cc-align cc-engine cc-vars cc-defs web-beautify imenu-list
reveal-in-osx-finder auto-dictionary flyspell ispell dired-async
dired-aux dired dired-loaddefs async editorconfig server ansible-doc ecb
ecb-symboldef ecb-analyse ecb-compatibility ecb-winman-support
ecb-autogen autoload radix-tree lisp-mnt ecb-tod ecb-cycle ecb-eshell
ecb-help ecb-jde ecb-method-browser hideshow ecb-semantic-wrapper
ecb-semantic ecb-file-browser ecb-speedbar ecb-layout ecb-create-layout
ecb-compilation ecb-common-browser ecb-navigate eieio-compat
ecb-mode-line ecb-face tree-buffer ecb-upgrade ecb-cedet-wrapper
semantic/db-find semantic/db-ref semantic/analyze semantic/sort
semantic/scope semantic/analyze/fcn ecb-util flymake-rust flymake-easy
flymake-proc flymake warnings rust-playground time-stamp cargo
cargo-process smartparens-rust rust-mode compile google-translate
google-translate-default-ui google-translate-core-ui
google-translate-core google-translate-tk url url-proxy url-privacy
url-expand url-methods url-history url-cookie url-domsuf url-util
mailcap lorem-ipsum company smartparens-config smartparens-text
smartparens thingatpt paredit ansible f yasnippet yaxception ht dash
know-your-http-well http-status-codes http-relations http-methods
http-headers s hydra lv cl-extra help-mode use-package up-delight
up-diminish up-ensure up-core pcase cl bind-key easy-mmode ido time
winner edmacro kmacro elec-pair desktop frameset semantic/mru-bookmark
semantic/db-mode semantic/db semantic/idle semantic/format semantic/ctxt
semantic/decorate/mode semantic/tag-ls semantic/find semantic/decorate
pulse semantic/util-modes semantic/util semantic semantic/tag
semantic/lex semantic/fw mode-local find-func ede/speedbar ede/files ede
ede/detect ede/base ede/auto ede/source eieio-base eieio-speedbar
speedbar sb-image ezimage dframe eieio-custom wid-edit cedet delsel
disp-table whitespace which-func imenu windmove tramp trampver
tramp-compat tramp-loaddefs shell pcomplete comint ansi-color ring
parse-time format-spec advice base16-circus-theme base16-theme time-date
finder-inf rx info package easymenu epg-config url-handlers url-parse
auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs
password-cache json map url-vars seq byte-opt gv bytecomp byte-compile
cconv cl-loaddefs cl-lib tooltip eldoc electric uniquify ediff-hook
vc-hooks lisp-float-type mwheel term/ns-win ns-win ucs-normalize
mule-util term/common-win tool-bar dnd fontset image regexp-opt fringe
tabulated-list replace newcomment text-mode elisp-mode lisp-mode
prog-mode register page menu-bar rfn-eshadow isearch timer select
scroll-bar mouse jit-lock font-lock syntax facemenu font-core
term/tty-colors frame cl-generic cham georgian utf-8-lang misc-lang
vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932
hebrew greek romanian slovak czech european ethiopic indian cyrillic
chinese composite charscript charprop case-table epa-hook jka-cmpr-hook
help simple abbrev obarray minibuffer cl-preloaded nadvice loaddefs
button faces cus-face macroexp files text-properties overlay sha1 md5
base64 format env code-pages mule custom widget hashtable-print-readable
backquote kqueue cocoa ns multi-tty make-network-process emacs)

Memory information:
((conses 16 934525 73980)
  (symbols 48 70113 11)
  (miscs 40 1160 1857)
  (strings 32 197950 10494)
  (string-bytes 1 6490921)
  (vectors 16 112100)
  (vector-slots 8 2419803 161810)
  (floats 8 597 408)
  (intervals 56 44366 1236)
  (buffers 992 49))


On 2018-02-19 18:50, Glenn Morris wrote:
> Christian Johansson wrote:
>
>> In GNU Emacs 26.0.60 (build 13, x86_64-apple-darwin17.3.0, NS appkit-1561.20 Version 10.13.2 (Build 17C205))
>>   of 2018-02-19 built on Christians-iMac
>> Repository revision: 020734c0e1a7ed8534df29992ffc4228d3663d89
> 26.0.60 is a rather old development version (before last October), and
> furthermore the git revision doesn't seem to correspond to anything in
> the Emacs repository.
>
>
>


[-- Attachment #2: Type: text/html, Size: 16905 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* bug#30533: 26.0.60; (copy-file) over TRAMP FTP mistakes file for directory
  2018-02-19  8:18 bug#30533: 26.0.60; (copy-file) over TRAMP FTP mistakes file for directory Christian Johansson
  2018-02-19 17:50 ` Glenn Morris
@ 2018-02-20 15:06 ` Michael Albinus
  1 sibling, 0 replies; 12+ messages in thread
From: Michael Albinus @ 2018-02-20 15:06 UTC (permalink / raw)
  To: Christian Johansson; +Cc: 30533

Christian Johansson <christian@mediastrategi.se> writes:

Hi Chrsitian,

> I have a case where Emacs have trouble understanding whether a remote
> file is a file or a directory, I run this code where PATH-LOCAL is on
> localhost and PATH-REMOTE is on a remote FTP via TRAMP
>
> (let ((file-or-directory (not (file-directory-p path-remote))))
>     (if file-or-directory
>         (progn
>           (message "Downloading file '%s' to '%s'.. (synchronously)" path-remote path-local)
>           (copy-file path-remote path-local t t t t)
>           (message "Download of file '%s' finished. (synchronously)" path-local))
>       (progn
>         (message "Downloading directory '%s' to '%s'.. (synchronously)" path-remote path-local)
>         (copy-directory path-remote path-local t t t)
>         (message "Download of directory '%s' finished. (synchronously)"
>     path-local))))
>
> The file .error-log will be transferred locally to .error-log/.error-log
> instead of .error-log. The filename does not matter.
>
> It seems (file-regular-p) mistakes remote files over TRAMP FTP more
> often than (file-directory-p). Maybe that is the cause of this problem.

I have problems in reproducing the scenario. Coul you, pls, give
examples of PATH-LOCAL and PATH-REMOTE?

It is also important to know, whether PATH-LOCAL is an existing file or
directory. Also, in case of a directory, it is important to know,
whether the string PATH_LOCAL has a trailing slash.

Thanks, and best regards, Michael.





^ permalink raw reply	[flat|nested] 12+ messages in thread

* bug#30533: 26.0.60; (copy-file) over TRAMP FTP mistakes file for directory
  2018-02-19 17:50 ` Glenn Morris
  2018-02-20  5:04   ` Christian Johansson
  2018-02-20 11:02   ` Christian Johansson
@ 2018-02-20 15:49   ` Christian Johansson
  2018-02-21  6:13     ` Christian Johansson
  2 siblings, 1 reply; 12+ messages in thread
From: Christian Johansson @ 2018-02-20 15:49 UTC (permalink / raw)
  To: 30533

Ok this doesn't work for me with latest trunk, this is a public ftp so 
you should be able to connect.

(let ((remote-path "/ftp:anonymous@speedtest.tele2.net:/1KB.zip")
       (local-path "~/Downloads/1KB.zip"))
   (if (file-regular-p remote-path)
       (progn
     (message "File %s is a regular file" remote-path)
     (copy-file remote-path local-path t t t t))
     (progn
       (message "File %s is a directory" remote-path)
       (copy-directory remote-path local-path t t t))))

Messages:
File /ftp:anonymous@speedtest.tele2.net:/1KB.zip is a directory
tramp-file-name-handler: Opening directory: Not a directory, 
/ftp:anonymous@speedtest.tele2.net:/1KB.zip






^ permalink raw reply	[flat|nested] 12+ messages in thread

* bug#30533: 26.0.60; (copy-file) over TRAMP FTP mistakes file for directory
  2018-02-20 15:49   ` Christian Johansson
@ 2018-02-21  6:13     ` Christian Johansson
  2018-02-21 13:31       ` Michael Albinus
  0 siblings, 1 reply; 12+ messages in thread
From: Christian Johansson @ 2018-02-21  6:13 UTC (permalink / raw)
  To: 30533

Here are two cases that display different tramp errors related to 
copy-file, but only if you don't open the remote path using dired-mode 
first.

;; Case 1
(let ((remote-path "/ftp:anonymous@speedtest.tele2.net:/1KB.zip")
       (local-path "~/Downloads/1KB.zip"))
   (if (file-directory-p remote-path)
       (progn
         (message "File %s is a directory" remote-path)
         (copy-directory remote-path local-path t t t))
     (progn
       (message "File %s is not a directory" remote-path)
       (copy-file remote-path local-path t t t t))))

;; Case 2
(let ((remote-path "/ftp:anonymous@speedtest.tele2.net:/1KB.zip")
       (local-path "~/Downloads/1KB.zip"))
   (if (file-regular-p remote-path)
       (progn
         (message "File %s is a regular file" remote-path)
         (copy-file remote-path local-path t t t t))
     (progn
       (message "File %s is not a regular file" remote-path)
       (copy-directory remote-path local-path t t t))))


If I first open the path in dired mode 
(/ftp:anonymous@speedtest.tele2.net) then the operations work as 
expected. It seems that tramp stores information about remote 
file-system when accessing it in dired-mode.

Even after restarting the problem seems to be gone when the remote path 
has been opened once in dired-mode. Is there some cache to this?


On 2018-02-20 16:49, Christian Johansson wrote:
> (let ((remote-path "/ftp:anonymous@speedtest.tele2.net:/1KB.zip")
>       (local-path "~/Downloads/1KB.zip"))
>   (if (file-regular-p remote-path)
>       (progn
>     (message "File %s is a regular file" remote-path)
>     (copy-file remote-path local-path t t t t))
>     (progn
>       (message "File %s is a directory" remote-path)
>       (copy-directory remote-path local-path t t t)))) 






^ permalink raw reply	[flat|nested] 12+ messages in thread

* bug#30533: 26.0.60; (copy-file) over TRAMP FTP mistakes file for directory
  2018-02-21  6:13     ` Christian Johansson
@ 2018-02-21 13:31       ` Michael Albinus
  2018-02-21 16:51         ` Christian Johansson
  2018-02-22  5:11         ` Christian Johansson
  0 siblings, 2 replies; 12+ messages in thread
From: Michael Albinus @ 2018-02-21 13:31 UTC (permalink / raw)
  To: Christian Johansson; +Cc: 30533

[-- Attachment #1: Type: text/plain, Size: 318 bytes --]

Christian Johansson <christian@cvj.se> writes:

Hi Christian,

> Here are two cases that display different tramp errors related to
> copy-file, but only if you don't open the remote path using dired-mode
> first.

Got it. In fact, ange-ftp has no file-regular-p implementation. I've
added this, could you, pls, test:


[-- Attachment #2: Type: text/plain, Size: 1528 bytes --]

diff --git a/lisp/net/ange-ftp.el b/lisp/net/ange-ftp.el
index e62bee4499..a267fc6448 100644
--- a/lisp/net/ange-ftp.el
+++ b/lisp/net/ange-ftp.el
@@ -3373,6 +3373,13 @@ ange-ftp-file-symlink-p
 	(file-error nil))
     (ange-ftp-real-file-symlink-p file)))
 
+(defun ange-ftp-file-regular-p (file)
+  ;; Reuse Tramp's implementation.
+  (if (ange-ftp-ftp-name file)
+      (and (file-exists-p file)
+       (eq ?- (aref (file-attribute-modes (file-attributes file)) 0)))
+    (ange-ftp-real-file-regular-p file)))
+
 (defun ange-ftp-file-exists-p (name)
   (setq name (expand-file-name name))
   (if (ange-ftp-ftp-name name)
@@ -4389,6 +4396,7 @@ ange-ftp-hook-function
 (put 'file-readable-p 'ange-ftp 'ange-ftp-file-readable-p)
 (put 'file-executable-p 'ange-ftp 'ange-ftp-file-executable-p)
 (put 'file-symlink-p 'ange-ftp 'ange-ftp-file-symlink-p)
+(put 'file-regular-p 'ange-ftp 'ange-ftp-file-regular-p)
 (put 'delete-file 'ange-ftp 'ange-ftp-delete-file)
 (put 'verify-visited-file-modtime 'ange-ftp
      'ange-ftp-verify-visited-file-modtime)
@@ -4477,6 +4485,8 @@ ange-ftp-real-file-executable-p
   (ange-ftp-run-real-handler 'file-executable-p args))
 (defun ange-ftp-real-file-symlink-p (&rest args)
   (ange-ftp-run-real-handler 'file-symlink-p args))
+(defun ange-ftp-real-file-regular-p (&rest args)
+  (ange-ftp-run-real-handler 'file-regular-p args))
 (defun ange-ftp-real-delete-file (&rest args)
   (ange-ftp-run-real-handler 'delete-file args))
 (defun ange-ftp-real-verify-visited-file-modtime (&rest args)

[-- Attachment #3: Type: text/plain, Size: 24 bytes --]


Best regards, Michael.

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* bug#30533: 26.0.60; (copy-file) over TRAMP FTP mistakes file for directory
  2018-02-21 13:31       ` Michael Albinus
@ 2018-02-21 16:51         ` Christian Johansson
  2018-02-21 17:05           ` Michael Albinus
  2018-02-22  5:11         ` Christian Johansson
  1 sibling, 1 reply; 12+ messages in thread
From: Christian Johansson @ 2018-02-21 16:51 UTC (permalink / raw)
  To: Michael Albinus; +Cc: 30533

[-- Attachment #1: Type: text/plain, Size: 2215 bytes --]

Hi!

Great, how do I pull your changes?

I can't find them in master and I have trouble finding a branch, should 
I just apply the same changes on my local environment?

Regards
Christian


On 2018-02-21 14:31, Michael Albinus wrote:
> Christian Johansson <christian@cvj.se> writes:
>
> Hi Christian,
>
>> Here are two cases that display different tramp errors related to
>> copy-file, but only if you don't open the remote path using dired-mode
>> first.
> Got it. In fact, ange-ftp has no file-regular-p implementation. I've
> added this, could you, pls, test:
>
>
>
> diff --git a/lisp/net/ange-ftp.el b/lisp/net/ange-ftp.el
> index e62bee4499..a267fc6448 100644
> --- a/lisp/net/ange-ftp.el
> +++ b/lisp/net/ange-ftp.el
> @@ -3373,6 +3373,13 @@ ange-ftp-file-symlink-p
>   	(file-error nil))
>       (ange-ftp-real-file-symlink-p file)))
>   
> +(defun ange-ftp-file-regular-p (file)
> +  ;; Reuse Tramp's implementation.
> +  (if (ange-ftp-ftp-name file)
> +      (and (file-exists-p file)
> +       (eq ?- (aref (file-attribute-modes (file-attributes file)) 0)))
> +    (ange-ftp-real-file-regular-p file)))
> +
>   (defun ange-ftp-file-exists-p (name)
>     (setq name (expand-file-name name))
>     (if (ange-ftp-ftp-name name)
> @@ -4389,6 +4396,7 @@ ange-ftp-hook-function
>   (put 'file-readable-p 'ange-ftp 'ange-ftp-file-readable-p)
>   (put 'file-executable-p 'ange-ftp 'ange-ftp-file-executable-p)
>   (put 'file-symlink-p 'ange-ftp 'ange-ftp-file-symlink-p)
> +(put 'file-regular-p 'ange-ftp 'ange-ftp-file-regular-p)
>   (put 'delete-file 'ange-ftp 'ange-ftp-delete-file)
>   (put 'verify-visited-file-modtime 'ange-ftp
>        'ange-ftp-verify-visited-file-modtime)
> @@ -4477,6 +4485,8 @@ ange-ftp-real-file-executable-p
>     (ange-ftp-run-real-handler 'file-executable-p args))
>   (defun ange-ftp-real-file-symlink-p (&rest args)
>     (ange-ftp-run-real-handler 'file-symlink-p args))
> +(defun ange-ftp-real-file-regular-p (&rest args)
> +  (ange-ftp-run-real-handler 'file-regular-p args))
>   (defun ange-ftp-real-delete-file (&rest args)
>     (ange-ftp-run-real-handler 'delete-file args))
>   (defun ange-ftp-real-verify-visited-file-modtime (&rest args)
>
>
> Best regards, Michael.


[-- Attachment #2: Type: text/html, Size: 2932 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* bug#30533: 26.0.60; (copy-file) over TRAMP FTP mistakes file for directory
  2018-02-21 16:51         ` Christian Johansson
@ 2018-02-21 17:05           ` Michael Albinus
  0 siblings, 0 replies; 12+ messages in thread
From: Michael Albinus @ 2018-02-21 17:05 UTC (permalink / raw)
  To: Christian Johansson; +Cc: 30533

Christian Johansson <christian@cvj.se> writes:

> Hi!

Hi Christian,

> Great, how do I pull your changes?
>
> I can't find them in master and I have trouble finding a branch,
> should I just apply the same changes on my local environment?

I haven't pushed them yet, waiting for your feedback. Pls apply the
patch locally.

The patch was produced on the emacs-26 branch, so there might be a line
number shift on master. Finally, I will commit it to master, when it
works for you.

> Regards
> Christian

Best regards, Michael.





^ permalink raw reply	[flat|nested] 12+ messages in thread

* bug#30533: 26.0.60; (copy-file) over TRAMP FTP mistakes file for directory
  2018-02-21 13:31       ` Michael Albinus
  2018-02-21 16:51         ` Christian Johansson
@ 2018-02-22  5:11         ` Christian Johansson
  2018-02-22 10:50           ` Michael Albinus
  1 sibling, 1 reply; 12+ messages in thread
From: Christian Johansson @ 2018-02-22  5:11 UTC (permalink / raw)
  To: Michael Albinus; +Cc: 30533

[-- Attachment #1: Type: text/plain, Size: 2381 bytes --]

Hi Michael!

Your fix fixed one of the issues. (file-regular-p) now works as expected 
over TRAMP ftp.

I can't reproduce the other one right now. There must be some kind of 
cache influencing the other issue.. I deleted the tramp directory but it 
had no effect.. I'll make a new report if I find a way to reproduce the 
other issue.

Regards
Christian


On 2018-02-21 14:31, Michael Albinus wrote:
> Christian Johansson <christian@cvj.se> writes:
>
> Hi Christian,
>
>> Here are two cases that display different tramp errors related to
>> copy-file, but only if you don't open the remote path using dired-mode
>> first.
> Got it. In fact, ange-ftp has no file-regular-p implementation. I've
> added this, could you, pls, test:
>
>
>
> diff --git a/lisp/net/ange-ftp.el b/lisp/net/ange-ftp.el
> index e62bee4499..a267fc6448 100644
> --- a/lisp/net/ange-ftp.el
> +++ b/lisp/net/ange-ftp.el
> @@ -3373,6 +3373,13 @@ ange-ftp-file-symlink-p
>   	(file-error nil))
>       (ange-ftp-real-file-symlink-p file)))
>   
> +(defun ange-ftp-file-regular-p (file)
> +  ;; Reuse Tramp's implementation.
> +  (if (ange-ftp-ftp-name file)
> +      (and (file-exists-p file)
> +       (eq ?- (aref (file-attribute-modes (file-attributes file)) 0)))
> +    (ange-ftp-real-file-regular-p file)))
> +
>   (defun ange-ftp-file-exists-p (name)
>     (setq name (expand-file-name name))
>     (if (ange-ftp-ftp-name name)
> @@ -4389,6 +4396,7 @@ ange-ftp-hook-function
>   (put 'file-readable-p 'ange-ftp 'ange-ftp-file-readable-p)
>   (put 'file-executable-p 'ange-ftp 'ange-ftp-file-executable-p)
>   (put 'file-symlink-p 'ange-ftp 'ange-ftp-file-symlink-p)
> +(put 'file-regular-p 'ange-ftp 'ange-ftp-file-regular-p)
>   (put 'delete-file 'ange-ftp 'ange-ftp-delete-file)
>   (put 'verify-visited-file-modtime 'ange-ftp
>        'ange-ftp-verify-visited-file-modtime)
> @@ -4477,6 +4485,8 @@ ange-ftp-real-file-executable-p
>     (ange-ftp-run-real-handler 'file-executable-p args))
>   (defun ange-ftp-real-file-symlink-p (&rest args)
>     (ange-ftp-run-real-handler 'file-symlink-p args))
> +(defun ange-ftp-real-file-regular-p (&rest args)
> +  (ange-ftp-run-real-handler 'file-regular-p args))
>   (defun ange-ftp-real-delete-file (&rest args)
>     (ange-ftp-run-real-handler 'delete-file args))
>   (defun ange-ftp-real-verify-visited-file-modtime (&rest args)
>
>
> Best regards, Michael.


[-- Attachment #2: Type: text/html, Size: 3113 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* bug#30533: 26.0.60; (copy-file) over TRAMP FTP mistakes file for directory
  2018-02-22  5:11         ` Christian Johansson
@ 2018-02-22 10:50           ` Michael Albinus
  0 siblings, 0 replies; 12+ messages in thread
From: Michael Albinus @ 2018-02-22 10:50 UTC (permalink / raw)
  To: Christian Johansson; +Cc: 30533-done

Christian Johansson <christian@cvj.se> writes:

> Hi Michael!

Hi Christian,

> Your fix fixed one of the issues. (file-regular-p) now works as
> expected over TRAMP ftp.

Thanks for the feedback. I've pushed the patch to the master branch,
closing this bug.

> Regards
> Christian

Best regards, Michael.





^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2018-02-22 10:50 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-19  8:18 bug#30533: 26.0.60; (copy-file) over TRAMP FTP mistakes file for directory Christian Johansson
2018-02-19 17:50 ` Glenn Morris
2018-02-20  5:04   ` Christian Johansson
2018-02-20 11:02   ` Christian Johansson
2018-02-20 15:49   ` Christian Johansson
2018-02-21  6:13     ` Christian Johansson
2018-02-21 13:31       ` Michael Albinus
2018-02-21 16:51         ` Christian Johansson
2018-02-21 17:05           ` Michael Albinus
2018-02-22  5:11         ` Christian Johansson
2018-02-22 10:50           ` Michael Albinus
2018-02-20 15:06 ` Michael Albinus

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).