On Mon, Sep 05, 2016 at 12:47:51PM +0930, Dan Kortschak wrote:
> func (f *RW) Write(ctx context.Context, req *fuse.WriteRequest, resp 
> *fuse.WriteResponse) error {
>       f.mu.Lock()
>       defer f.mu.Unlock()
> 
>       f.mtime = f.fs.now()
> 
>       var err error
>       if req.FileFlags&fuse.OpenTruncate != 0 {
>               err = f.dev.Truncate(req.Offset)
>               if err != nil {
>                       return err
>               }
>       }

These are just the flags passed to open. If you want to act on the
truncate flag, do it once within open, not on every single subsequent
call to write.

-- 
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