Is there a way to make the function directory-files be insensitive to
the upper and lower case when matching file names. I know case is
important on Unix but so on Windoze.
I really don't want to have to do:
(directory-files "." nil "[Rr][Ee][Aa][Dd][Mm][Ee].*")
Alternatively, is their a way to convert an string into
something like "[Ss][Tt][Rr]..."?
Thanks,
Keith
It seems like it ought to be simple, like binding `case-fold-search' to nil
around the call to `directory-files', or temporarily installing a non-
translating case table, but I can't figure out how to do it.
> Alternatively, is their a way to convert an string into
> something like "[Ss][Tt][Rr]..."?
(format "[%s]" (mapconcat (lambda (char)
(format "%c%c" (upcase char) (downcase char)))
"string"
"]["))
--
Kevin Rodgers <kev...@ihs.com> Lead Software Engineer
Information Handling Services Electronic Systems Development
15 Inverness Way East, M/S A201 GO BUFFS!
Englewood CO 80112-5776 USA 1 303 397 2807[voice]/2244[fax]
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
|> In article <7d8vmu$38k$1...@agate.berkeley.edu>,
|> km...@socrates.berkeley.edu () wrote:
|> > Is there a way to make the function directory-files be insensitive to
|> > the upper and lower case when matching file names. I know case is
|> > important on Unix but so on Windoze.
|> >
|> > I really don't want to have to do:
|> > (directory-files "." nil "[Rr][Ee][Aa][Dd][Mm][Ee].*")
|>
|> It seems like it ought to be simple, like binding `case-fold-search' to nil
|> around the call to `directory-files', or temporarily installing a non-
|> translating case table, but I can't figure out how to do it.
This is not possible. The choice of case folding is hard coded (on for
VMS, off for all others).
--
Andreas Schwab "And now for something
sch...@issan.cs.uni-dortmund.de completely different"
sch...@gnu.org