diff --git a/src/GToolkit-Inspector/AbstractFileReference.extension.st b/src/GToolkit-Inspector/AbstractFileReference.extension.st index c3e8d852..61f85e7a 100644 --- a/src/GToolkit-Inspector/AbstractFileReference.extension.st +++ b/src/GToolkit-Inspector/AbstractFileReference.extension.st @@ -419,11 +419,13 @@ AbstractFileReference >> gtPharoScriptFor: aView [ { #category : #'*GToolkit-Inspector' } AbstractFileReference >> gtSaveContents: newContents [ - (self fullName , '.backup') asFileReference ensureDelete. - self copyTo: (self fullName , '.backup') asFileReference. - ^ self - ensureDelete; - writeStreamDo: [ :s | s nextPutAll: newContents ] + | newFile | + newFile := self , 'new'. + newFile ensureDelete. + newFile writeStreamDo: [ :stream | stream nextPutAll: newContents ]. + self ensureDelete. + newFile renameTo: self basename. + ^ newFile ] { #category : #'*GToolkit-Inspector' }