[squeak-dev] Sanity check r.e. Files-tpr.156

David T. Lewis lewis at mail.msen.com
Sat Jun 4 02:23:41 UTC 2016


If StandardFileStream>>flush is meant to flush everything from the Squeak
stream out of the VM and into the operating system buffers, whatever that
might happen to mean, and if StandardFileStream>>primSync: is supposed to
instruct the operating system to write everything that it knows about in
its buffers out to some physical storage medium, whatever that might happen
to mean, then I have to think that StandardFileStream>>sync should do a
#flush prior to #primSync:, otherwise we might expect that things in the
VM (C runtime stdio library) might still be unflushed, and that the #sync
on the low level descriptor might apply to stale data.

If we need to mix up the higher level stdio flush with the lowever level
file descriptor sync (and yes, we apparently do need to do that), then we
should probably be forcing a flush before primSync:

StandardFileStream>>sync
	"Really, really, flush pending changes"
	^self flush; primSync: fileID

Does that sound right?

Dave



More information about the Squeak-dev mailing list