Hi,

How would you replace a piece of text in a file with another one and persist the change on disk?

Right now, I have:

file := 'path' asFileReference
contents := file readStreamDo: #contents.
newContents := contents copyReplaceAll: 'PATTERN' with: 'TARGET'.��
file
ensureDelete;��
writeStreamDo: [ :s | s nextPutAll: newContents asString ]

Any idea to make this more concise?

Cheers,
Doru

--
www.tudorgirba.com

"Every thing has its own flow"