<div dir="ltr">Hi Tim,<div class="gmail_extra"><br><div class="gmail_quote">On Sat, May 21, 2016 at 10:49 AM, tim Rowledge <span dir="ltr">&lt;<a href="mailto:tim@rowledge.org" target="_blank">tim@rowledge.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">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.<br>
<br>
An interesting thing is that I ‘remembered’ that we flush files when closing them but in fact we don’t. The file flush primitive is barely used, so far as I can only really for stdio flushing. So adding a fsync call to the flush primitive would barely affect anything and I’d have to amend the Scratch file writing code to use it.<br>
<br>
Is anyone using code that regularly flushes filestreams and might have a performance issue if an fsync were added?<br></blockquote><div><br></div><div>Well, the case is that it /is/ a performance issue.  Writing to disc is way more expensive than flushing to kernel buffers.  How about saying what you think about my c) and d) options?  That&#39;s a way of avoiding the performance issue and solving the kids-are-humans issue.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">tim<br>
--<br>
tim Rowledge; <a href="mailto:tim@rowledge.org">tim@rowledge.org</a>; <a href="http://www.rowledge.org/tim" rel="noreferrer" target="_blank">http://www.rowledge.org/tim</a><br>
</span>Strange OpCodes: BOMB: Burn Out Memory Banks<br></blockquote><div> </div></div><div class="gmail_signature"><div dir="ltr"><div><span style="font-size:small;border-collapse:separate"><div>_,,,^..^,,,_<br></div><div>best, Eliot</div></span></div></div></div>
</div></div>