| fileName myFile journal metaData existing utf8Name | fileName := 'myFile.txt'. myFile := FileStream fileNamed: fileName. SugarLauncher isRunningInSugar ifTrue: [ journal := SugarDataStore new. metaData := {'title'->fileName. 'mime_type'->'text/plain'} as: Dictionary. existing := (journal find: metaData with: #()) first. existing isEmpty ifFalse: [ metaData := existing first. utf8Name := journal getFilename: (metaData at: 'uid') asString. myFile nextPutAll: (FileStream readOnlyFileNamed: utf8Name utf8ToSqueak) contentsOfEntireFile. FileDirectory default deleteFileNamed: utf8Name utf8ToSqueak]]. myFile setToEnd. myFile cr. myFile nextPutAll: 'Hello'. myFile tab. myFile print: Time now. myFile close. SugarLauncher isRunningInSugar ifTrue: [ utf8Name := (FileDirectory default fullNameFor: fileName) squeakToUtf8. metaData at: 'timestamp' put: DateAndTime now asUnixTime. metaData at: 'mtime' put: (DateAndTime now asString first: 19). existing isEmpty ifTrue: [journal create: metaData with: utf8Name with: false] ifFalse: [journal update: (metaData at: 'uid') with: metaData with: utf8Name with: false]. FileDirectory default deleteFileNamed: fileName].