tramp ($Id: tramp.el,v 1.449 2001/02/20 10:02:30 grossjoh Exp $); No indication if remote file has changed on disk

2001-03-16 Thread Daniel Katz


Enter your bug report in this message, including as much detail as you
possibly can about the problem, what you did to cause it and what the
local and remote machines are.

If you can give a simple set of instructions to make this bug happen
reliably, please include those.  Thank you for helping kill bugs in
TRAMP.
--bug report follows this line--

1) Create file on machine1 as:  "$ echo "foo" > foo"
2) Open file in emacs on machine2:  C-x C-f /r:dkatz@machine1:foo
3) Change file on machine1 as:  "$ echo "bar" >> foo"
   (Emacs session on machine2 is still active)
4) Revisit file on machine2: C-x C-f /r:dkatz@machine1:foo
   (Same session as in step 2)

With a local file, emacs would notice that the file had changed on
disk and offer to re-read it into the buffer.  Files that I visit by
tramp don't notice that the file has changed and don't ask whether I
want to refresh the buffer.

Note that if I kill the buffer and then re-visit the file, I get the
new version of the file.  The problem only arises if I try to revisit
a file which has already been visited.

Emacs  : GNU Emacs 20.7.2 (i386-debian-linux-gnu, X toolkit)
 of Tue Jul 25 2000 on raven
Package: tramp ($Id: tramp.el,v 1.449 2001/02/20 10:02:30 grossjoh Exp $)

current state:
==
(setq
 tramp-ls-command nil
 tramp-test-groks-nt nil
 tramp-file-exists-command nil
 tramp-current-method nil
 tramp-current-user nil
 tramp-current-host nil
 tramp-auto-save-directory nil
 tramp-default-method "sm"
 tramp-rsh-end-of-line "\n"
 tramp-remote-path '("/bin" "/usr/bin" "/usr/sbin" "/usr/local/bin"
 "/usr/ccs/bin" "/local/bin" "/local/freeware/bin"
 "/local/gnu/bin" "/usr/freeware/bin" "/usr/pkg/bin")
 tramp-login-prompt-regexp ".*ogin: *$"
 tramp-password-prompt-regexp "^.*\\([pP]assword\\|passphrase.*\\):? *$"
 tramp-wrong-passwd-regexp "^.*\\(Permission denied.\\|Login [Ii]ncorrect\\|Received 
signal [0-9]+\\|Connection \\(refused\\|closed\\)\\|Sorry, try again.\\|Name or 
service not known\\).*$"
 tramp-temp-name-prefix "tramp."
 tramp-file-name-structure 
'("\\`/r\\(@\\([a-z0-9]+\\)\\)?:\\(\\([-a-z0-9_#]+\\)@\\)?\\([-a-z0-9.]+\\):\\(.*\\)\\'"
 2 4 5 6)
 tramp-file-name-regexp "\\`/r[@:]"
 tramp-make-tramp-file-format "/r@%m:%u@%h:%p"
 tramp-end-of-output "/"
 shell-prompt-pattern "^[^#$%>\n]*[#$%>] *"
 backup-by-copying nil
 backup-by-copying-when-linked nil
 backup-by-copying-when-mismatch nil
 )




Re: tramp ($Id: tramp.el,v 1.449 2001/02/20 10:02:30 grossjoh Exp $); No indication if remote file has changed on disk

2001-03-16 Thread Kai Großjohann

On 16 Mar 2001, Daniel Katz wrote:
> 
> With a local file, emacs would notice that the file had changed on
> disk and offer to re-read it into the buffer.  Files that I visit by
> tramp don't notice that the file has changed and don't ask whether I
> want to refresh the buffer.

I wonder how does Emacs know that the file has changed in the local
case?  Maybe it is asking for the file attributes (especially the last
modification It's difficult to get this value in the general case.
But if there is a Perl on the remote system, Tramp can use it.  Just
include the directory where the Perl binary is in tramp-remote-path.

kai
-- 
Be indiscrete.  Do it continuously.




Re: tramp ($Id: tramp.el,v 1.449 2001/02/20 10:02:30 grossjoh Exp $); No indication if remote file has changed on disk

2001-03-16 Thread Daniel Pittman

On 16 Mar 2001, Kai Großjohann wrote:
> On 16 Mar 2001, Daniel Katz wrote:
>> 
>> With a local file, emacs would notice that the file had changed on
>> disk and offer to re-read it into the buffer.  Files that I visit by
>> tramp don't notice that the file has changed and don't ask whether I
>> want to refresh the buffer.
> 
> I wonder how does Emacs know that the file has changed in the local
> case?  

`verify-visited-file-modtime'

It's implemented in tramp2, so you can probably steal it from there.

Daniel

-- 
In a minute there is time
For decisions and revisions which a minute will reverse.
-- T.S. Eliot