From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Stefan Monnier" Newsgroups: gmane.emacs.devel Subject: Re: file-symlink-p for remote files? Date: Tue, 08 Apr 2003 14:31:55 -0400 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <200304081831.h38IVtTG029258@rum.cs.yale.edu> References: <847ka5qafi.fsf@lucy.is.informatik.uni-duisburg.de> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1049826749 23092 80.91.224.249 (8 Apr 2003 18:32:29 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 8 Apr 2003 18:32:29 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Tue Apr 08 20:32:24 2003 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 192xtQ-0005zz-00 for ; Tue, 08 Apr 2003 20:32:24 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 192xxX-0000Mu-00 for ; Tue, 08 Apr 2003 20:36:39 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 192xtA-0008FC-0B for emacs-devel@quimby.gnus.org; Tue, 08 Apr 2003 14:32:08 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 192xt0-0008Em-00 for emacs-devel@gnu.org; Tue, 08 Apr 2003 14:31:58 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 192xsz-0008EY-00 for emacs-devel@gnu.org; Tue, 08 Apr 2003 14:31:58 -0400 Original-Received: from rum.cs.yale.edu ([128.36.229.169]) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 192xsz-0008EU-00 for emacs-devel@gnu.org; Tue, 08 Apr 2003 14:31:57 -0400 Original-Received: from rum.cs.yale.edu (localhost [127.0.0.1]) by rum.cs.yale.edu (8.12.8/8.12.8) with ESMTP id h38IVtx6029260; Tue, 8 Apr 2003 14:31:55 -0400 Original-Received: (from monnier@localhost) by rum.cs.yale.edu (8.12.8/8.12.8/Submit) id h38IVtTG029258; Tue, 8 Apr 2003 14:31:55 -0400 X-Mailer: exmh version 2.4 06/23/2000 with nmh-1.0.4 Original-To: kai.grossjohann@gmx.net (Kai =?iso-8859-1?q?Gro=DFjohann?=) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Emacs development discussions. List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:13035 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:13035 > Let's say I have a remote system with a symlink, like so: > > $ ls -ld /foo > lrwxrwxrwx 1 root root 9 Feb 28 14:51 /foo -> /bar > > Note that the symlink target is given as an absolute name. > > Which value should be returned by (file-symlink-p "/user@host:/foo")? > > (1) "/user@host:/bar" > (2) "/bar" > (3) something else, please specify: ___________________________ I like to think of symlinks as "special files" that can contain arbitrary text (as used for example by Emacs in its file locking protocol), but in practice this poses problems, so I think the right answer is option (1). See for example ange-ftp. The reason is that there are elisp routines (such as file-truename I guess) that do the symlink-dereference manually rather than relying on the OS to do it for use. Stefan