ignore case for PC-filenames when searching for matches.
--- a/Filename.st Mon Aug 03 21:17:51 1998 +0200
+++ b/Filename.st Mon Aug 03 21:24:30 1998 +0200
@@ -1979,20 +1979,21 @@
The pattern may be a simple matchPattern, or a set of
multiple patterns separated by semicolons."
- |matchers|
+ |matchers notCaseSensitive|
matchers := aPattern asCollectionOfSubstringsSeparatedBy:$;.
+ notCaseSensitive := self class isCaseSensitive not.
^ self directoryContents
- select:[:name |
- (matchers detect:[:p | p match:name] ifNone:0) ~~ 0
- ]
+ select:[:name |
+ (matchers detect:[:p | p match:name ignoreCase:notCaseSensitive] ifNone:0) ~~ 0
+ ]
"
'/etc' asFilename filesMatching:'a*;c*'
"
- "Created: 15.4.1997 / 15:40:02 / cg"
- "Modified: 15.4.1997 / 15:41:33 / cg"
+ "Created: / 15.4.1997 / 15:40:02 / cg"
+ "Modified: / 3.8.1998 / 21:22:15 / cg"
!
filesMatchingWithoutDotDirs:aPattern
@@ -2002,14 +2003,16 @@
The pattern may be a simple matchPattern, or a set of
multiple patterns separated by semicolons."
- |matchers|
+ |matchers notCaseSensitive|
matchers := aPattern asCollectionOfSubstringsSeparatedBy:$;.
+ notCaseSensitive := self class isCaseSensitive not.
+
^ self directoryContents
- select:[:name |
- name ~= '.'
- and:[name ~= '..'
- and:[(matchers detect:[:p | p match:name] ifNone:0) ~~ 0]]
+ select:[:name |
+ name ~= '.'
+ and:[name ~= '..'
+ and:[(matchers detect:[:p | p match:name ignoreCase:notCaseSensitive] ifNone:0) ~~ 0]]
]
"
@@ -2018,8 +2021,8 @@
'../../libbasic' asFilename filesMatching:'[A-D]*.st'
"
- "Created: 15.4.1997 / 12:52:10 / cg"
- "Modified: 15.4.1997 / 15:41:40 / cg"
+ "Created: / 15.4.1997 / 12:52:10 / cg"
+ "Modified: / 3.8.1998 / 21:22:30 / cg"
!
isAbsolute
@@ -2935,6 +2938,6 @@
!Filename class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic/Filename.st,v 1.125 1998-08-03 14:48:08 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/Filename.st,v 1.126 1998-08-03 19:24:30 cg Exp $'
! !
Filename initialize!