From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Lars Hansen Newsgroups: gmane.emacs.tramp,gmane.emacs.devel Subject: ls-lisp and remote files Date: Thu, 30 Oct 2003 21:06:44 +0100 Sender: tramp-devel-bounces+tramp=quimby.gnus.org@nongnu.org Message-ID: <3FA16F54.80201@math.ku.dk> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1067544527 11934 80.91.224.253 (30 Oct 2003 20:08:47 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 30 Oct 2003 20:08:47 +0000 (UTC) Cc: tramp-devel@nongnu.org Original-X-From: tramp-devel-bounces+tramp=quimby.gnus.org@nongnu.org Thu Oct 30 21:08:43 2003 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AFJ63-0006KE-00 for ; Thu, 30 Oct 2003 21:08:43 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1AFJ63-000793-00 for ; Thu, 30 Oct 2003 21:08:43 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AFJ5F-0003Qh-Es for tramp@quimby.gnus.org; Thu, 30 Oct 2003 15:07:53 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1AFJ4l-0003QJ-Fv for tramp-devel@nongnu.org; Thu, 30 Oct 2003 15:07:23 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1AFJ4F-0003Nu-6x for tramp-devel@nongnu.org; Thu, 30 Oct 2003 15:07:22 -0500 Original-Received: from [62.84.220.10] (helo=post.kabelnettet.dk) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AFJ4E-0003Nd-Nn for tramp-devel@nongnu.org; Thu, 30 Oct 2003 15:06:50 -0500 Original-Received: from math.ku.dk [62.84.220.219] by post.kabelnettet.dk with ESMTP (SMTPD32-8.03) id AF667B0352; Thu, 30 Oct 2003 21:07:02 +0100 User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.0) Gecko/20020623 Debian/1.0.0-0.woody.1 X-Accept-Language: en Original-To: emacs-devel@gnu.org X-BeenThere: tramp-devel@nongnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: tramp-devel-bounces+tramp=quimby.gnus.org@nongnu.org Xref: main.gmane.org gmane.emacs.tramp:1393 gmane.emacs.devel:17622 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:17622 I have been working on making ls-lisp work for remote files. To do that I have made a Tramp implementation of directory-files-and-attributes using perl on the remote machine. This works fine except for the translation of UID's and GID's to names. To make this translation, ls-lisp calls user-login-name which works in the context of the local machine, and that is wrong for remote directories. Of cource one could just let ls-lisp check if the directory is remote and make no translation if it is. However, I sugest the following: 1. Add an optional parameter ID-NAMES to the lisp functions file-attributes and directory-files-and-attributes. When ID-NAMES is non-nil, UID and GID is returned as names if possible. 2. Let ls-lisp use this feature to obtain UID and GID names. I have implemented these change on my own machine (dired.c, lisp.h, ls-lisp.el, tramp.el) and it seems to work fine. I want to ask people what you think about this suggestion. ---------------- One more related thing. IFAICS it is a bug that the current implementation of ls-lisp calls user-login-name to obtain group name. user-login-name calls getpwuid, but getgrgid should be used for that, I think. It might work on GNU/Linux systems but it fails on Sun systems, at least the one I have access to. On the Sun system UID's and GID's are not disjoint. With the changes I suggest above there is no need to make a lisp interface to getgrgid since the translation may be done in dired.c.