From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.devel Subject: Re: [PATCH 2/5] [mingw]: Have compiled-file-name produce valid names. Date: Tue, 03 May 2011 09:44:10 +0200 Message-ID: References: <1297784103-18322-1-git-send-email-janneke-list@xs4all.nl> <1297784103-18322-3-git-send-email-janneke-list@xs4all.nl> <87r58gzuoy.fsf@gnu.org> <87vcxsycds.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1304408672 13769 80.91.229.12 (3 May 2011 07:44:32 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 3 May 2011 07:44:32 +0000 (UTC) Cc: Eli Barzilay , guile-devel@gnu.org To: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Tue May 03 09:44:26 2011 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QHAHR-0007O3-DJ for guile-devel@m.gmane.org; Tue, 03 May 2011 09:44:25 +0200 Original-Received: from localhost ([::1]:42195 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QHAHQ-0001VS-W0 for guile-devel@m.gmane.org; Tue, 03 May 2011 03:44:24 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:57821) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QHAHO-0001VK-HP for guile-devel@gnu.org; Tue, 03 May 2011 03:44:23 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QHAHM-00051o-RL for guile-devel@gnu.org; Tue, 03 May 2011 03:44:22 -0400 Original-Received: from a-pb-sasl-sd.pobox.com ([64.74.157.62]:43171 helo=sasl.smtp.pobox.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QHAHM-00051j-Kh; Tue, 03 May 2011 03:44:20 -0400 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTP id 01A522241; Tue, 3 May 2011 03:46:24 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type:content-transfer-encoding; s=sasl; bh=Es//8iO8JuG3 RHxIlJZQfpFHVjs=; b=K5B9YNGN7oNCfLI56lO3MiXpaMWjfSKsaQMdFt/MDSdi eJ/T1NsMHAEIlNhAB/hxFTdDCxA2SlSaFsgpWl1WgI4glvxd02Opi1Gl6ao7EeSg qNCBCxWt34BCpG7/zCaB4NM6w/mEr8LPcf6oLXF4BIBARsArhdgmhsFQEF/IieE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type:content-transfer-encoding; q=dns; s=sasl; b=Hy4d5s +krJTNEF5LUJl2q6nPUG7xx/2LcLa2L8+6X1EQsmi2SB5cyBGJdN/WN5s3BPCTMQ SU1M7ccxjT3nvKBH/RqvDlgf3vM+fNUDmd8Z83adLyHYHhtnKzKdmqB+zyKmS6Dr 0/Dxe4DRRJUaaQ1ElTXTF95KSp9BIaT+r2T3A= Original-Received: from a-pb-sasl-sd.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTP id D18D6223E; Tue, 3 May 2011 03:46:20 -0400 (EDT) Original-Received: from unquote.localdomain (unknown [90.164.198.39]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTPSA id CC534223D; Tue, 3 May 2011 03:46:17 -0400 (EDT) In-Reply-To: <87vcxsycds.fsf@gnu.org> ("Ludovic =?utf-8?Q?Court=C3=A8s=22'?= =?utf-8?Q?s?= message of "Tue, 03 May 2011 00:18:55 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) X-Pobox-Relay-ID: 6FB413C2-7559-11E0-B2FE-E8AB60295C12-02397024!a-pb-sasl-sd.pobox.com X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-Received-From: 64.74.157.62 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:12410 Archived-At: On Tue 03 May 2011 00:18, ludo@gnu.org (Ludovic Court=C3=A8s) writes: >> I still think that we need at least the ability to pass a bytevector as >> a path name, on GNU systems; and that if we can do so, then any routine >> that needs to deal with a path name would then need to deal in byte >> vectors in addition to strings, and at that point perhaps it is indeed >> useful to have a path library. > > To accommodate various file name encodings, right? Then yes. That's the crazy thing: file names on GNU aren't in any encoding! They are byte strings that may or may not decode to a string, given some encoding. Granted, they're mostly UTF-8 these days, but users have the darndest files... > I think GLib and the like expect UTF-8 as the file name encoding and > complain otherwise, so UTF-8 might be a better default than locale > encoding (and it=E2=80=99s certainly wiser to be locale-independent.) It's more complicated than that. Here's the old interface that they used, which attempted to treat paths as utf-8: http://developer.gnome.org/glib/unstable/glib-Character-Set-Conversion.ht= ml (search for "file name encoding") The new API is abstract, so it allows operations like "get-display-name" and "get-bytes": http://developer.gnome.org/gio/2.28/GFile.html (search for "encoding" in that page) "All GFiles have a basename (get with g_file_get_basename()). These names are byte strings that are used to identify the file on the filesystem (relative to its parent directory) and there is no guarantees that they have any particular charset encoding or even make any sense at all. If you want to use filenames in a user interface you should use the display name that you can get by requesting the G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME attribute with g_file_query_info(). This is guaranteed to be in utf8 and can be used in a user interface. But always store the real basename or the GFile to use to actually access the file, because there is no way to go from a display name to the actual name." > So volumes matter in the file name canonicalization of the .go cache > right? > > Couldn=E2=80=99t we mimic /cygdrive/c, etc.? Is that what cygwin does? We certainly could, yes; though for the purposes of joining the cache dir to an absolute filename, I guess we could simply change c:/foo to /c/foo... Hum! Andy --=20 http://wingolog.org/