--- a/Filename.st Mon Feb 11 10:19:44 2002 +0100
+++ b/Filename.st Mon Feb 11 10:20:16 2002 +0100
@@ -560,53 +560,6 @@
"Created: / 19.5.1999 / 12:24:26 / cg"
!
-readingFile:aPathName do:aBlock
- "create a read-stream on a file, evaluate aBlock, passing that stream,
- and return the blocks value.
- Ensures that the stream is closed."
-
- |stream result|
-
- stream := aPathName asFilename readStream.
- [
- result := aBlock value:stream
- ] ensure:[
- stream close
- ].
- ^ result
-
- "
- |rslt|
-
- rslt := Filename
- readingFile:'/etc/passwd'
- do:[:s |
- Transcript showCR:s nextLine
- ].
- "
-
- "
- Filename
- readingFile:'/etc/passwd'
- do:
- [:s |
- |shells|
-
- shells := Bag new.
- s linesDo:
- [:line |
- |parts|
-
- parts := line asCollectionOfSubstringsSeparatedBy:$:.
- shells add:(parts seventh).
- ].
- shells contents
- ].
- "
-
- "Modified: / 31.10.2001 / 09:25:45 / cg"
-!
-
remoteHost:remoteHostString rootComponents:aCollectionOfDirectoryNames
"create & return a new filename from components given in
aCollectionOfDirectoryNames on a host named remoteHostString.
@@ -1173,6 +1126,55 @@
"Modified: 8.9.1997 / 00:35:19 / cg"
! !
+!Filename class methodsFor:'utilities'!
+
+readingFile:aPathName do:aBlock
+ "create a read-stream on a file, evaluate aBlock, passing that stream,
+ and return the blocks value.
+ Ensures that the stream is closed."
+
+ |stream result|
+
+ stream := aPathName asFilename readStream.
+ [
+ result := aBlock value:stream
+ ] ensure:[
+ stream close
+ ].
+ ^ result
+
+ "
+ |rslt|
+
+ rslt := Filename
+ readingFile:'/etc/passwd'
+ do:[:s |
+ Transcript showCR:s nextLine
+ ].
+ "
+
+ "
+ Filename
+ readingFile:'/etc/passwd'
+ do:
+ [:s |
+ |shells|
+
+ shells := Bag new.
+ s linesDo:
+ [:line |
+ |parts|
+
+ parts := line asCollectionOfSubstringsSeparatedBy:$:.
+ shells add:(parts seventh).
+ ].
+ shells contents
+ ].
+ "
+
+ "Modified: / 31.10.2001 / 09:25:45 / cg"
+! !
+
!Filename methodsFor:'Compatibility - VW5.4'!
asLogicalFileSpecification
@@ -4218,6 +4220,6 @@
!Filename class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic/Filename.st,v 1.209 2002-02-11 09:19:44 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/Filename.st,v 1.210 2002-02-11 09:20:16 cg Exp $'
! !
Filename initialize!