Home
Reading
Searching
Subscribe
Sponsors
Statistics
Posting
Contact
Spam
Lists
Links
About
Hosting
Filtering
Features Download
Marketing
Archives
FAQ
Blog
 
Gmane
From: Don Cohen <don-sourceforge-xxzw <at> isis.cs3-inc.com>
Subject: Re: using pathnames containing wildcard characters
Newsgroups: gmane.lisp.clisp.general
Date: Tuesday 31st January 2012 20:28:18 UTC (over 5 years ago)
Fred Cohen writes:
 > > TRT, IMO, is to quote wild characters in some way, either escaping
them
 > > with backslashes or using special type of "wild strings" vs "literal
 > > strings".
 > Go for it. Just make certain that all UTF 8 byte values are legal for
 > all operations and that we can get everything in terms of those
 > byte/UTF-8 sequences, and I will be happy enough (assuming it works as

I don't think that UTF is quite the right thing, but this raises 
another interesting point.
It seems odd that you should have to know what character set a file
system uses in order to read and process a directory.  For instance, 
you should be able to copy a directory accurately without that
information.  This suggests that we need an encoding that maps 1-1
between bytes and characters.  I notice that CHARSET:ISO-8859-1 is
almost right:
 (with-open-file (f "/tmp/bytes" :direction :output :element-type
                    '(unsigned-byte 8) :if-does-not-exist :create)
   (loop for i below 256 do (write-byte i f)))

 (with-open-file (f "/tmp/bytes" :external-format CHARSET:ISO-8859-1)
   (loop for i from 0 while (setf c (read-char f nil nil)) 
         unless  (= i (char-code c)) do (princ (cons i (char-code c)))))
 (13 . 10)

Is there a way to separate CR from LF or create an encoding with that
property?  We should be able to get back from (directory ...) one
pathname containing a CR and another containing a LF.

In the past I've always resorted to binary IO in such cases, but that
doesn't seem to be an option in the case of (directory ...).
If I had such an encoding then perhaps I would not need to read files
as bytes and then translate them to characters via code-char.


------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
clisp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/clisp-list
 
CD: 3ms