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

Eliot Miranda eliot.miranda at gmail.com
Sun May 22 15:34:51 UTC 2016





_,,,^..^,,,_ (phone)
> On May 21, 2016, at 10:36 PM, John Pfersich <smalltalker2 at mac.com> wrote:
> 
> 
> 
> 
> Sent from my iPad
>>> On May 21, 2016, at 22:07, David T. Lewis <lewis at mail.msen.com> wrote:
>>> 
>>> 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
> And I don't think that people that yank the power cord should be catered to. If you do stupid things, you should pay the consequences. A computer isn't a toaster. And teachers should convey that to their students. 

Are you a parent?  Children are human beings.

I remember when I first joined ParcPlace talking with Phil Yelland who was in charge of the native GUI project that was killed by the DarkPlace-Dodgytalk merger.  He told of a situation where a Windows machine told him he didn't have permission to shut the machine down.  "Really?", he thought.  "Well then you shouldn't leave the power cord unprotected.", and yanked the power cord.

Come on man, be human.  Machines are supposed to serve us, especially itty nutty $35 machines.  Of course youngsters will turn them off (I do by mistake), and of course teachers can't be expected to be systems programmers and be able to explain their consequent insights to very young children.  So yes, the system should use fsync when appropriate, to serve the users, not the inanimate or the partially omniscient.


More information about the Squeak-dev mailing list