From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27325 invoked by alias); 16 Jun 2008 03:22:31 -0000 Received: (qmail 27316 invoked by uid 22791); 16 Jun 2008 03:22:30 -0000 X-Spam-Check-By: sourceware.org Received: from mtaout5.012.net.il (HELO mtaout5.012.net.il) (84.95.2.13) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 16 Jun 2008 03:22:08 +0000 Received: from HOME-C4E4A596F7 ([84.228.242.237]) by i_mtaout5.012.net.il (HyperSendmail v2004.12) with ESMTPA id <0K2J00FLGE1XFXG0@i_mtaout5.012.net.il> for gdb-patches@sources.redhat.com; Mon, 16 Jun 2008 06:37:10 +0300 (IDT) Date: Mon, 16 Jun 2008 03:32:00 -0000 From: Eli Zaretskii Subject: Re: Better realpath In-reply-to: <20080616012933.GA9279@caradoc.them.org> X-012-Sender: halo1@inter.net.il To: Daniel Jacobowitz Cc: vladimir@codesourcery.com, gdb-patches@sources.redhat.com Reply-to: Eli Zaretskii Message-id: References: <200806141024.41812.vladimir@codesourcery.com> <200806141614.07742.vladimir@codesourcery.com> <20080615032653.GA5214@caradoc.them.org> <20080616012933.GA9279@caradoc.them.org> X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-06/txt/msg00302.txt.bz2 > Date: Sun, 15 Jun 2008 21:29:33 -0400 > From: Daniel Jacobowitz > Cc: vladimir@codesourcery.com, gdb-patches@sources.redhat.com > > On Sun, Jun 15, 2008 at 08:58:29PM +0300, Eli Zaretskii wrote: > > I don't mind doing so, although libiberty has other customers, which > > could make it harder for us to do what we think is right (if it > > happens to be different from what lrealpath does now). Note that > > right now, lrealpath does not behave consistently with realpath (if > > the latter is unavailable), so it cannot be regarded as a portable > > version of realpath, at least not entirely so. > > I assume that it is simply an oversight when Windows support was > added But canonicalize_filename also behaves like the Windows version does. > > Not just for GDB, in general as well: it doesn't seem right to me to > > expand a file name and check for its existence in the same primitive, > > not to mention refuse to produce an expansion if the file does not > > exist. These are two separate tests, so they should be kept separate. > > (I actually suspect that realpath was used because it's more > > convenient -- no messy memory allocation issues -- but I have no facts > > to back this up.) > > On the other hand, it seems perfectly reasonable to me; we can't know > where the file would really be if it existed, unless it exists, since > we don't know whether it would be a symlink. I don't see any problem with this behavior for non-existing files. And, if we want to resolve symlinks, the Windows code should also do that.