[squeak-dev] Adding fsync() call to the primitiveFileFlush prim ?

David T. Lewis lewis at mail.msen.com
Sun May 22 05:07:45 UTC 2016


On Sat, May 21, 2016 at 10:49:24AM -0700, tim Rowledge wrote:
> The issue here is that the PI - especially when used in schools - is storing everything on a micro-SD card. Being surrounded by kids is a scary thing for a computer. They don???t necessarily bother to do a nice system shutdown or even exit Scratch before yanking the power. Teachers don???t necessarily know to tell them to; lots of people doing their best with insufficient knowledge.
> 

D'oh, now I get it. I was not thinking of the case of yanking the power cord.
I can well imagine that this might be a bit disruptive for normal process exit
cleanups that are supposed to ensure that fflushed buffers actually make it
to the disk-like media.

> An interesting thing is that I ???remembered??? that we flush files when closing them but in fact we don???t.

In a perfect world you do not need to flush a file when closing it, because
closing it implies a flush (e.g. fclose performs an fflush). That said,
yanking the power cord might introduce some imperfections.

Dave



More information about the Squeak-dev mailing list