unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#32325: 27.0.50; dired-create-directory: timing issue in remote machine
@ 2018-07-31  5:02 Tino Calancha
  2018-07-31 15:07 ` Eli Zaretskii
  0 siblings, 1 reply; 5+ messages in thread
From: Tino Calancha @ 2018-07-31  5:02 UTC (permalink / raw)
  To: 32325; +Cc: michael.albinus

X-Debbugs-Cc: michael.albinus@gmx.de

emacs -Q -l dired-aux
;; Connect with Dired into a remote machine:
(dired "/ssh:USER@MACHINE:PATH")

;; I) Create a directory
+ a/b RET

;; II) Right after run this:

(file-exists-p (dired-get-filename))
=> nil

;; Sometimes I get `t' sometimes `nil'.  Maybe a timing issue?
;; I see the problem just in remote machines; in my local box the
;; previous command always returns `t'.

;; Another way is change II) by simply:
f
;; That is, run `dired-find-file' as soon as the new directory shows up.
;; Sometimes you get the error:
dired-get-file-for-visit: File no longer exists; type ‘g’ to update Dired buffer

In GNU Emacs 27.0.50 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.22.11)
 of 2018-07-31
Repository rev1ision: 63ef79329935b790b9c8107125bce66e1f272c2e
Windowing system distributor 'The X.Org Foundation', version 11.0.11902000
System Description: Debian GNU/Linux 9 (stretch)





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

* bug#32325: 27.0.50; dired-create-directory: timing issue in remote machine
  2018-07-31  5:02 bug#32325: 27.0.50; dired-create-directory: timing issue in remote machine Tino Calancha
@ 2018-07-31 15:07 ` Eli Zaretskii
  2018-07-31 20:43   ` Michael Albinus
  0 siblings, 1 reply; 5+ messages in thread
From: Eli Zaretskii @ 2018-07-31 15:07 UTC (permalink / raw)
  To: Tino Calancha; +Cc: michael.albinus, 32325

> From: Tino Calancha <tino.calancha@gmail.com>
> Date: Tue, 31 Jul 2018 14:02:13 +0900
> Cc: michael.albinus@gmx.de
> 
> emacs -Q -l dired-aux
> ;; Connect with Dired into a remote machine:
> (dired "/ssh:USER@MACHINE:PATH")
> 
> ;; I) Create a directory
> + a/b RET
> 
> ;; II) Right after run this:
> 
> (file-exists-p (dired-get-filename))
> => nil
> 
> ;; Sometimes I get `t' sometimes `nil'.  Maybe a timing issue?

I think Tramp uses some caching?  Michael will know for sure.





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

* bug#32325: 27.0.50; dired-create-directory: timing issue in remote machine
  2018-07-31 15:07 ` Eli Zaretskii
@ 2018-07-31 20:43   ` Michael Albinus
  2018-08-01  4:53     ` Tino Calancha
  0 siblings, 1 reply; 5+ messages in thread
From: Michael Albinus @ 2018-07-31 20:43 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 32325, Tino Calancha

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

Eli Zaretskii <eliz@gnu.org> writes:

Hi,

>> emacs -Q -l dired-aux
>> ;; Connect with Dired into a remote machine:
>> (dired "/ssh:USER@MACHINE:PATH")
>> 
>> ;; I) Create a directory
>> + a/b RET
>> 
>> ;; II) Right after run this:
>> 
>> (file-exists-p (dired-get-filename))
>> => nil
>> 
>> ;; Sometimes I get `t' sometimes `nil'.  Maybe a timing issue?
>
> I think Tramp uses some caching?  Michael will know for sure.

Indeed.  Could you (Tino), pls, test the appended patch?

Best regards, Michael.


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

diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index 2d253506dd..86e82d4092 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -2547,7 +2547,11 @@ tramp-sh-handle-make-directory
   "Like `make-directory' for Tramp files."
   (setq dir (expand-file-name dir))
   (with-parsed-tramp-file-name dir nil
-    (tramp-flush-directory-properties v (file-name-directory localname))
+    ;; When PARENTS is non-nil, DIR could be a chain of non-existent
+    ;; directories a/b/c/...  Instead of checking, we simply flush the
+    ;; whole cache.
+    (tramp-flush-directory-properties
+     v (if parents "/" (file-name-directory localname)))
     (save-excursion
       (tramp-barf-unless-okay
        v (format "%s %s"

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

* bug#32325: 27.0.50; dired-create-directory: timing issue in remote machine
  2018-07-31 20:43   ` Michael Albinus
@ 2018-08-01  4:53     ` Tino Calancha
  2018-08-01 21:15       ` Michael Albinus
  0 siblings, 1 reply; 5+ messages in thread
From: Tino Calancha @ 2018-08-01  4:53 UTC (permalink / raw)
  To: Michael Albinus; +Cc: 32325

Michael Albinus <michael.albinus@gmx.de> writes:

>> I think Tramp uses some caching?  Michael will know for sure.
> Indeed.  Could you (Tino), pls, test the appended patch?
Thank you Michael, your patch fixes the issue!





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

* bug#32325: 27.0.50; dired-create-directory: timing issue in remote machine
  2018-08-01  4:53     ` Tino Calancha
@ 2018-08-01 21:15       ` Michael Albinus
  0 siblings, 0 replies; 5+ messages in thread
From: Michael Albinus @ 2018-08-01 21:15 UTC (permalink / raw)
  To: Tino Calancha; +Cc: 32325-done

Version: 27.1

Tino Calancha <tino.calancha@gmail.com> writes:

Hi Tino,

>> Indeed.  Could you (Tino), pls, test the appended patch?
> Thank you Michael, your patch fixes the issue!

Thanks for the feedback, I've pushed the patch to master. Closing the
bug.

Best regards, Michael.





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

end of thread, other threads:[~2018-08-01 21:15 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-31  5:02 bug#32325: 27.0.50; dired-create-directory: timing issue in remote machine Tino Calancha
2018-07-31 15:07 ` Eli Zaretskii
2018-07-31 20:43   ` Michael Albinus
2018-08-01  4:53     ` Tino Calancha
2018-08-01 21:15       ` 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).