From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mark H Weaver Newsgroups: gmane.lisp.guile.devel Subject: Re: [PATCH 2/5] [mingw]: Have compiled-file-name produce valid names. Date: Sun, 01 May 2011 17:48:54 -0400 Message-ID: <871v0ium61.fsf@netris.org> References: <1297784103-18322-1-git-send-email-janneke-list@xs4all.nl> <1297784103-18322-3-git-send-email-janneke-list@xs4all.nl> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1304286577 21813 80.91.229.12 (1 May 2011 21:49:37 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 1 May 2011 21:49:37 +0000 (UTC) Cc: guile-devel@gnu.org To: Andy Wingo Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sun May 01 23:49:33 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 1QGeWB-0004Cy-5R for guile-devel@m.gmane.org; Sun, 01 May 2011 23:49:31 +0200 Original-Received: from localhost ([::1]:34120 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QGeWA-000839-E7 for guile-devel@m.gmane.org; Sun, 01 May 2011 17:49:30 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:39966) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QGeW7-000834-Ft for guile-devel@gnu.org; Sun, 01 May 2011 17:49:28 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QGeW6-0003SD-0t for guile-devel@gnu.org; Sun, 01 May 2011 17:49:27 -0400 Original-Received: from world.peace.net ([96.39.62.75]:59071) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QGeW5-0003Rd-UC for guile-devel@gnu.org; Sun, 01 May 2011 17:49:25 -0400 Original-Received: from 209-6-39-128.c3-0.smr-ubr1.sbo-smr.ma.cable.rcn.com ([209.6.39.128] helo=freedomincluded) by world.peace.net with esmtpa (Exim 4.69) (envelope-from ) id 1QGeVo-0001Rv-2x; Sun, 01 May 2011 17:49:08 -0400 Original-Received: from mhw by freedomincluded with local (Exim 4.69) (envelope-from ) id 1QGeVb-0004nK-F6; Sun, 01 May 2011 17:48:55 -0400 In-Reply-To: (Andy Wingo's message of "Sun, 01 May 2011 13:30:30 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 96.39.62.75 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:12397 Archived-At: Andy Wingo writes: > On Fri 29 Apr 2011 19:30, Noah Lavine writes: >> Also, are there any characters that are valid in filenames on some >> systems but invalid on other systems? > > Ah, I see you are under the delusion that paths are composed of > characters :) This is not the case. To the OS, paths are > NUL-terminated byte arrays, with some constraints about their > composition, but which are not necessarily representable as strings. This is the case on POSIX, but we should keep in mind that on some systems (e.g. Windows NT) filenames are considered character data, or at least so says PEP 383 IMHO, it would be best to avoid embedding into Guile the assumption that filenames, environment variables, command-line arguments, etc, are really bytevectors. > Basically I think the plan should be to add scm_from_locale_path, > scm_from_raw_path, etc to filesys.[ch], and change any > pathname-accepting procedure in Guile to accept path objects, producing > them from strings when given strings, and pass the bytevector > representation to the raw o/s procedures like `open' et al. I like this idea, but we should keep in mind that we face the same problem with things like environment variables, command-line arguments, etc. Ideally, we should try to come up with a coherent story and set of APIs for dealing with all of these data that are string-like, but actually bytevectors on some systems. Mark