From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Kai.Grossjohann@CS.Uni-Dortmund.DE (Kai =?iso-8859-15?q?Gro=DFjohann?=) Newsgroups: gmane.emacs.devel Subject: Re: tramp-handle-file-newer-than-file-p Date: Sat, 17 Aug 2002 21:10:39 +0200 Sender: emacs-devel-admin@gnu.org Message-ID: References: <874rdwjfgu.fsf@lexx.delysid.org> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1029611422 26775 127.0.0.1 (17 Aug 2002 19:10:22 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sat, 17 Aug 2002 19:10:22 +0000 (UTC) Cc: emacs-devel@gnu.org Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 17g8xm-0006xd-00 for ; Sat, 17 Aug 2002 21:10:18 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 17g9OM-00030R-00 for ; Sat, 17 Aug 2002 21:37:46 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 17g8yk-0004q7-00; Sat, 17 Aug 2002 15:11:18 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10) id 17g8yH-0004pt-00 for emacs-devel@gnu.org; Sat, 17 Aug 2002 15:10:49 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10) id 17g8yE-0004ph-00 for emacs-devel@gnu.org; Sat, 17 Aug 2002 15:10:48 -0400 Original-Received: from waldorf.cs.uni-dortmund.de ([129.217.4.42]) by monty-python.gnu.org with esmtp (Exim 4.10) id 17g8yE-0004pc-00 for emacs-devel@gnu.org; Sat, 17 Aug 2002 15:10:46 -0400 Original-Received: from lothlorien.cs.uni-dortmund.de (lothlorien [129.217.19.67]) by waldorf.cs.uni-dortmund.de with ESMTP id g7HJAib12782; Sat, 17 Aug 2002 21:10:44 +0200 (MES) Original-Received: from lucy.cs.uni-dortmund.de (lucy [129.217.19.80]) by lothlorien.cs.uni-dortmund.de id VAA04173; Sat, 17 Aug 2002 21:10:39 +0200 (MET DST) Original-Received: by lucy.cs.uni-dortmund.de (Postfix, from userid 6104) id 3C3E43B145; Sat, 17 Aug 2002 21:10:39 +0200 (CEST) Original-To: Mario Lang In-Reply-To: <874rdwjfgu.fsf@lexx.delysid.org> (Mario Lang's message of "Thu, 15 Aug 2002 17:42:41 +0200") Original-Lines: 39 User-Agent: Gnus/5.090008 (Oort Gnus v0.08) Emacs/21.3.50 (i686-pc-linux-gnu) Errors-To: emacs-devel-admin@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.devel:6603 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:6603 Mario Lang 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)