Sometime you just need a good sleep, which I was fortunate to have. My newer code append contents to existing file, so it lead to corrupted files at the end. Ensuring it is deleted first solved the problem: (location asFileReference / filename) ensureDelete binaryWriteStreamDo: [ :fileStream |      fileStream nextPutAll: stream contents] There is still the issue of XML entity I described in an previous email, the impact is minor for Dr. Geo though. Do other have issues with that? Hilaire Le 15/06/2018 à 18:31, Hilaire a écrit :
This fromer code to save file (xml or PNG file):
" |streamOnDisk| Â Â Â [streamOnDisk := MultiByteFileStream forceNewFileNamed: (self absolutePath: filename). Â Â Â streamOnDisk nextPutAll: stream contents] ensure: Â Â Â Â Â Â [streamOnDisk close]"
and the newer one:
   (location asFileReference / filename) binaryWriteStreamDo: [ :fileStream |       fileStream nextPutAll: stream contents]
The new one produce both wrong XML file and PNG file. The file looks short cuted at the end.
-- Dr. Geo http://drgeo.eu