emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: tramp-handle-file-newer-than-file-p


From: Kai Großjohann
Subject: Re: tramp-handle-file-newer-than-file-p
Date: Sat, 17 Aug 2002 21:10:39 +0200
User-agent: Gnus/5.090008 (Oort Gnus v0.08) Emacs/21.3.50 (i686-pc-linux-gnu)

Mario Lang <address@hidden> writes:

> But said function explicitly prevents that:
>
> (defun tramp-handle-file-newer-than-file-p (file1 file2)
>   "Like `file-newer-than-file-p' for tramp files."
>   (cond ((not (file-exists-p file1))
>          nil)
>         ((not (file-exists-p file2))
>          t)
>         ;; We are sure both files exist at this point.  We assume that
>         ;; both files are Tramp files, otherwise we issue an error
>         ;; message.
>
> Is it really necessary to do that?  Can't we just compare them here.  If
> yes, that would be really great for emacs-wiki publishing :).

Tramp does not always know the modtime of the remote file, and
comparing a local and a remote file needs the modtime.

Some time later, support was added to Tramp so that it knows the
modtime of a remote file in some cases, but I was too lazy to update
tramp-handle-file-newer-than-file-p accordingly.  I figured that
people would complain if they needed it :-)

Why does Tramp not always know the modtime?  Because I didn't know of
a portable way to find it.  "ls -l" prints something but it's not the
exact time and it's not clear which way to err.

Why does Tramp sometimes know the modtime?  Because Tramp looks for
Perl on the remote end, and Perl can tell the modtime.

How can Tramp compare modtimes without knowing them?  Because some
"test" implementations have a newer-than test built-in, and for the
others, a kludge involving "find" can be used.

kai
-- 
A large number of young women don't trust men with beards.  (BFBS Radio)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]