On Thu, Jul 21, 2016 at 2:17 PM, Manlio Perillo <manlio.peri...@gmail.com> wrote: > On Thu, Jul 21, 2016 at 8:39 PM, Konstantin Khomoutov > 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.
File access in Unix and Unix-like systems is a lot like Go: If you conform to its design decisions and do things the way it wants you to do them, you'll end up having a pretty good time; however, if you try to make it conform to the way you imagine things should work, you're just going to end up creating problems for yourself down the road. If you don't absolutely need to sync (or don't know if you need to sync or not but aren't seeing problems), don't. Let the kernel handle how and when your files get written (or your network gets flushed, or whatever the case may be), and it will be able to optimize under the hood, make the best utilization of its file cache, and generally do all the good things it wants to do for you. —Sam -- Sam Whited pub 4096R/54083AE104EA7AD3 -- 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.