--- a/Filename.st Wed Aug 01 16:20:38 2018 +0200
+++ b/Filename.st Wed Aug 01 18:12:06 2018 +0200
@@ -6777,23 +6777,23 @@
"Created: / 09-11-2012 / 10:07:41 / sr"
!
-contents:aStringOrCollectionOfLines
+contents:aStringOrByteArrayOrCollectionOfLines
"create (or overwrite) a file given its contents as a collection of lines.
Raises an error, if the file is unwritable."
^ self
- writingFileDo:[:s |
- aStringOrCollectionOfLines isNonByteCollection ifTrue:[
- "a StringCollection or a collection of lines"
- aStringOrCollectionOfLines do:[:each | s nextPutLine:(each ? '')]
- ] ifFalse:[
- "something string-like"
- aStringOrCollectionOfLines isString ifFalse:[
- s binary
- ].
- s nextPutAll:aStringOrCollectionOfLines
- ]
- ].
+ writingFileDo:[:s |
+ aStringOrByteArrayOrCollectionOfLines isNonByteCollection ifTrue:[
+ "a StringCollection or a collection of lines"
+ aStringOrByteArrayOrCollectionOfLines do:[:each | s nextPutLine:(each ? '')]
+ ] ifFalse:[
+ "something string-like"
+ aStringOrByteArrayOrCollectionOfLines isString ifFalse:[
+ s binary
+ ].
+ s nextPutAll:aStringOrByteArrayOrCollectionOfLines
+ ]
+ ].
"
'foo1' asFilename contents:#('one' 'two' 'three')
@@ -6803,6 +6803,7 @@
"Created: / 11-12-2006 / 14:11:21 / cg"
"Modified: / 08-11-2007 / 13:28:41 / cg"
+ "Modified (format): / 01-08-2018 / 18:11:58 / Claus Gittinger"
!
writingFileDo:aBlock