[squeak-dev] The Trunk: Files-tpr.156.mcz

Levente Uzonyi leves at caesar.elte.hu
Tue May 24 19:32:47 UTC 2016


I suppose #sync should do nothing when the FileStream is not writable.

Levente

On Tue, 24 May 2016, commits at source.squeak.org wrote:

> tim Rowledge uploaded a new version of Files to project The Trunk:
> http://source.squeak.org/trunk/Files-tpr.156.mcz
>
> ==================== Summary ====================
>
> Name: Files-tpr.156
> Author: tpr
> Time: 24 May 2016, 10:00:21.788027 am
> UUID: a9fad8c9-8c36-480a-8c66-1521c4e1bf16
> Ancestors: Files-cmm.155
>
> Add call to the fsync file flushing/synchronising primitive, plus a #sync method to use it.
>
> =============== Diff against Files-cmm.155 ===============
>
> Item was added:
> + ----- Method: FileStream>>sync (in category 'file open/close') -----
> + sync
> + 	"sync the current buffer out to disk."
> +
> + 	self subclassResponsibility
> + !
>
> Item was added:
> + ----- Method: StandardFileStream>>primSync: (in category 'primitives') -----
> + primSync: id
> + 	"Call fsync to really, really, flush pending changes to the disk"
> + 	| p |
> + 	<primitive: 'primitiveFileSync' module: 'FilePlugin'>
> + 	"In some OS's seeking to 0 and back will do a flush. Maybe that will help if we dont have the primitives"
> + 	p := self position.
> + 	self position: 0; position: p!
>
> Item was added:
> + ----- Method: StandardFileStream>>sync (in category 'read, write, position') -----
> + sync
> + 	"Really, really, flush pending changes"
> + 	^self primSync: fileID!
>
>
>


More information about the Squeak-dev mailing list