From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kevin Rodgers Newsgroups: gmane.emacs.help Subject: Re: Multiple people touching the same file with ange-ftp Date: Fri, 12 Jan 2007 01:00:31 -0700 Message-ID: References: <1168468857.210422.271210@i39g2000hsf.googlegroups.com> <1168469572.611178.86730@77g2000hsv.googlegroups.com> <1168536873.593252.264520@i56g2000hsf.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1168588892 31074 80.91.229.12 (12 Jan 2007 08:01:32 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 12 Jan 2007 08:01:32 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Jan 12 09:01:30 2007 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1H5HLr-0001qA-TV for geh-help-gnu-emacs@m.gmane.org; Fri, 12 Jan 2007 09:01:28 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H5HLr-0005wW-Mf for geh-help-gnu-emacs@m.gmane.org; Fri, 12 Jan 2007 03:01:27 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1H5HLW-0005rq-H9 for help-gnu-emacs@gnu.org; Fri, 12 Jan 2007 03:01:06 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1H5HLU-0005rJ-Oh for help-gnu-emacs@gnu.org; Fri, 12 Jan 2007 03:01:06 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H5HLU-0005rF-Md for help-gnu-emacs@gnu.org; Fri, 12 Jan 2007 03:01:04 -0500 Original-Received: from [80.91.229.2] (helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1H5HLU-0006Bg-5v for help-gnu-emacs@gnu.org; Fri, 12 Jan 2007 03:01:04 -0500 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1H5HLI-0005Ct-4O for help-gnu-emacs@gnu.org; Fri, 12 Jan 2007 09:00:53 +0100 Original-Received: from c-24-9-156-178.hsd1.co.comcast.net ([24.9.156.178]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 12 Jan 2007 09:00:52 +0100 Original-Received: from kevin.d.rodgers by c-24-9-156-178.hsd1.co.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 12 Jan 2007 09:00:52 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-To: help-gnu-emacs@gnu.org Original-Lines: 55 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: c-24-9-156-178.hsd1.co.comcast.net User-Agent: Thunderbird 1.5.0.9 (Macintosh/20061207) In-Reply-To: <1168536873.593252.264520@i56g2000hsf.googlegroups.com> X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:40250 Archived-At: rgb wrote: > Kevin Rodgers wrote: >> rgb wrote: >>> I see the command MDTM being attempted and the response >>> 'command not understood' coming back. >>> If I could intercept this, the DIR command does show the modification >>> time so I should be able to find and return it. >> Searching for MDTM in ange-ftp.el leads one to ange-ftp-file-modtime. >> > > Yes I did notice that. Thanks > As yet I don't see an obvious way to override or intercept that > function on a host by host basis. > I see examples of host specific calls being set up like this. > (add-to-list 'ange-ftp-parse-list-func-alist > '(vms . ange-ftp-parse-vms-listing)) > But it doesn't work for this function. > I'm sure, with some further study > I'll find a way. It's been a slow process so far. Perhaps putting > advice around it is the only way. > There seems to be lots of essoteric knowledge needed to > retrieve the data needed to compute the time too. > I'm continuing to plug away at it and will keep my eye here > for shortcuts or advise on the best way to proceed. You could start by making ange-ftp-file-modtime extensible, the same way ange-ftp-parse-listing is extensible via the ange-ftp-parse-list-func-alist variable: (defvar ange-ftp-file-modtime-func-alist nil "Alist saying how to return modification time of remote file. Association list of \( TYPE \. FUNC \) pairs, where FUNC is a routine which returns the modification time of a remote file from a host of type TYPE.") (defadvice ange-ftp-file-modtime (around func-alist activate) "If `ange-ftp-file-modtime-func-alist' has an entry for FILE's host type, return the result of calling that function." (let* ((ftp-name (ange-ftp-ftp-name file)) (host (nth 0 ftp-name)) (user (nth 1 ftp-name)) (name (nth 2 ftp-name)) (func (assq (ange-ftp-host-type host) ange-ftp-file-modtime-func-alist))) (if func (funcall func file) ad-do-it))) Now you just have to implement ange-ftp-file-modtime-for-FOO and add (FOO . ange-ftp-file-modtime-for-FOO) to ange-ftp-file-modtime-func-alist, assuming ange-ftp-host-type returns FOO for file's on your server. :-) -- Kevin Rodgers Denver, Colorado, USA