--- a/FileURI.st Wed Jul 09 18:18:48 2003 +0200
+++ b/FileURI.st Thu Jul 10 11:42:47 2003 +0200
@@ -129,11 +129,13 @@
- a collection with a stream on a single file,
- or a collection with streams on a directorie's files, but not recursive"
- |attributes fn files|
+ |attributes fn files list|
fn := self asFilename.
files := OrderedCollection new.
+ list := OrderedCollection new.
attributes := self class attributes.
+
fn isDirectory ifTrue:[
attributes at:#requestDirectory put:true.
(DirectoryContents directoryNamed:fn pathName) filesDo:[:aFile|
@@ -144,6 +146,25 @@
files add:fn.
].
+ fn isDirectory ifFalse:[ |bName|
+ bName := fn baseName.
+ (bName startsWith:'*') ifTrue:[
+ files removeAll.
+ fn := fn directory.
+ attributes at:#requestDirectory put:true.
+ (DirectoryContents directoryNamed:fn pathName) filesDo:[:aFile|
+ files add:aFile
+ ].
+ ].
+ (bName startsWith:'*.') ifTrue:[ |rest|
+ rest := bName restAfter:$*.
+ (rest includesString:'*') ifTrue:[
+ self error:'can''t resolve path:', self printString
+ ].
+ files := files select:[:aFile| aFile pathName endsWith:rest ]
+ ].
+ ].
+
files do:[:aFile| |baseName stream|
[
baseName := aFile baseName.
@@ -235,5 +256,5 @@
!FileURI class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic2/FileURI.st,v 1.3 2003-07-09 12:55:42 tm Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic2/FileURI.st,v 1.4 2003-07-10 09:42:36 tm Exp $'
! !