On Nov 17, 10:27 pm, Awaken <
awake...@gmail.com> wrote:
> To Brad,
> You didn't get me.
> The problem is that there is no way to explicitly sync the file
> written by ioutil.WriteFile unless one gets the handler of the file
> again.
>
> Another way around this is let ioutil.WriteFile to return a *os.File
> as well.
The problem with having it return the file descriptor (or *os.File) is
that os.File.Close destroys the underlying file descriptor. For it to
return the value, it would have to defer responsibility for closing
the file to the calling code -- something that seems nonsensical to
me.