There are almost no use cases that require syncing the file. The operating
system is designed with a good buffering layer for a reason. If you do have
such need, it is trivial to write your own version of WriteFile that does
this.

On Thu, Jul 21, 2016 at 9:17 PM, Manlio Perillo <manlio.peri...@gmail.com>
wrote:

> On Thu, Jul 21, 2016 at 8:39 PM, Konstantin Khomoutov
> <flatw...@users.sourceforge.net> wrote:
> > On Thu, 21 Jul 2016 11:17:18 -0700 (PDT)
> > Manlio Perillo <manlio.peri...@gmail.com> wrote:
> >
> >> What is the reason why ioutil.WriteFile does not call File.Sync?
> >
> > I'd say that's because to inhibit this behaviour when needed you'd need
> > to implement ioutil.WriteFileNoSync() or have an option flag as an
> > argument (remember CreateFile() of Win32 API?).
>
> I'm curious to know why one wants to inhibit the durability behaviour.
> AFAIK, several design choices of Go and its standard library are
> designed to make program safe and robust.
> WriteFile does not follow these principles.
>
> > [...]
>
> Manlio
>
> --
> You received this message because you are subscribed to the Google Groups
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to golang-nuts+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to