unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Kai.Grossjohann@CS.Uni-Dortmund.DE (Kai Großjohann)
Cc: emacs-devel@gnu.org
Subject: Re: tramp-handle-file-newer-than-file-p
Date: Sat, 17 Aug 2002 21:10:39 +0200	[thread overview]
Message-ID: <vafelcxcndc.fsf@INBOX.auto.emacs.devel.tok.lucy.cs.uni-dortmund.de> (raw)
In-Reply-To: <874rdwjfgu.fsf@lexx.delysid.org> (Mario Lang's message of "Thu, 15 Aug 2002 17:42:41 +0200")

Mario Lang <mlang@debian.org> 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	other threads:[~2002-08-17 19:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-08-15 15:42 tramp-handle-file-newer-than-file-p Mario Lang
2002-08-17 19:10 ` Kai Großjohann [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=vafelcxcndc.fsf@INBOX.auto.emacs.devel.tok.lucy.cs.uni-dortmund.de \
    --to=kai.grossjohann@cs.uni-dortmund.de \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).