Sanity check r.e. Files-tpr.156

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Sanity check r.e. Files-tpr.156

David T. Lewis
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


Reply | Threaded
Open this post in threaded view
|

Re: Sanity check r.e. Files-tpr.156

timrowledge

> On 03-06-2016, at 7:23 PM, David T. Lewis <[hidden email]> wrote:
>
> StandardFileStream>>sync
> "Really, really, flush pending changes"
> ^self flush; primSync: fileID
>
> Does that sound right?

Makes reasonable sense to me, inasmuch as any of it does.

tim
--
tim Rowledge; [hidden email]; http://www.rowledge.org/tim
Never do at  compile-time what you can put off till run-time



Reply | Threaded
Open this post in threaded view
|

Re: Sanity check r.e. Files-tpr.156

David T. Lewis
On Fri, Jun 03, 2016 at 07:55:30PM -0700, tim Rowledge wrote:

>
> > On 03-06-2016, at 7:23 PM, David T. Lewis <[hidden email]> wrote:
> >
> > StandardFileStream>>sync
> > "Really, really, flush pending changes"
> > ^self flush; primSync: fileID
> >
> > Does that sound right?
>
> Makes reasonable sense to me, inasmuch as any of it does.
>

OK, sounds reasonable, it might not be right but it certainly is not wrong
so I committed the update.

Dave