func (f *File) Touch() error {
	exists, err := f.Exists()
	if err != nil {
		return err
	}
	if !exists {
		return f.createEmptyFile()
	}
	enabled, err := f.isBucketVersioningEnabled()
	if err != nil {
		return err
	}
	if enabled {
		return utils.UpdateLastModifiedByMoving(f)
	}
	return f.updateLastModifiedByAttrUpdate()
}
Touch creates a zero-length file on the vfs.File if no File exists.  Update File's last modified timestamp.
Returns error if unable to touch File.
package gs
import (
	"bytes"
	"context"
	"fmt"
	"io"
	"io/ioutil"
	"os"
	"path"
	"time"
	"cloud.google.com/go/storage"
	"github.com/c2fo/vfs/v6"
	"github.com/c2fo/vfs/v6/backend"
	"github.com/c2fo/vfs/v6/utils"
)
const (
	doesNotExistError = "storage: object doesn't exist"
)
type File struct {
	fileSystem  *FileSystem
	bucket      string
	key         string
	tempFile    *os.File
	writeBuffer *bytes.Buffer
}
func (f *File) Close() error {
	if f.tempFile != nil {
		defer func() { _ = f.tempFile.Close() }()
		err := os.Remove(f.tempFile.Name())
		if err != nil && !os.IsNotExist(err) {
			return err
		}
		f.tempFile = nil
	}
	if f.writeBuffer != nil {
		handle, err := f.getObjectHandle()
		if err != nil {
			return err
		}
		ctx, cancel := context.WithCancel(f.fileSystem.ctx)
		defer cancel()
		w := handle.NewWriter(ctx)
		defer func() { _ = w.Close() }()
		buffer := make([]byte, utils.TouchCopyMinBufferSize)
		if _, err := io.CopyBuffer(w, f.writeBuffer, buffer); err != nil {
			return err
		}
	}
	f.writeBuffer = nil
	return nil
}
func (f *File) Read(p []byte) (n int, err error) {
	if err := f.checkTempFile(); err != nil {
		return 0, err
	}
	return f.tempFile.Read(p)
}
func (f *File) Seek(offset int64, whence int) (int64, error) {
	if err := f.checkTempFile(); err != nil {
		return 0, err
	}
	return f.tempFile.Seek(offset, whence)
}
func (f *File) Write(data []byte) (n int, err error) {
	if f.writeBuffer == nil {
		f.writeBuffer = bytes.NewBuffer([]byte{})
	}
	return f.writeBuffer.Write(data)
}
func (f *File) String() string {
	return f.URI()
}
func (f *File) Exists() (bool, error) {
	_, err := f.getObjectAttrs()
	if err != nil {
		if err.Error() == doesNotExistError {
			return false, nil
		}
		return false, err
	}
	return true, nil
}
func (f *File) Location() vfs.Location {
	return vfs.Location(&Location{
		fileSystem: f.fileSystem,
		prefix:     utils.EnsureTrailingSlash(utils.EnsureLeadingSlash(path.Clean(path.Dir(f.key)))),
		bucket:     f.bucket,
	})
}
func (f *File) CopyToLocation(location vfs.Location) (vfs.File, error) {
	dest, err := location.NewFile(f.Name())
	if err != nil {
		return nil, err
	}
	err = f.CopyToFile(dest)
	if err != nil {
		return nil, err
	}
	return dest, nil
}
func (f *File) CopyToFile(file vfs.File) error {
	if err := backend.ValidateCopySeekPosition(f); err != nil {
		return err
	}
	if tf, ok := file.(*File); ok {
		options, ok := tf.Location().FileSystem().(*FileSystem).options.(Options)
		if ok {
			if f.isSameAuth(&options) {
				return f.copyWithinGCSToFile(tf)
			}
		}
	}
	fileBufferSize := 0
	if opts, ok := f.Location().FileSystem().(*FileSystem).options.(Options); ok {
		fileBufferSize = opts.FileBufferSize
	}
	if err := utils.TouchCopyBuffered(file, f, fileBufferSize); err != nil {
		return err
	}
	if cerr := file.Close(); cerr != nil {
		return cerr
	}
	return f.Close()
}
func (f *File) MoveToLocation(location vfs.Location) (vfs.File, error) {
	newFile, err := f.CopyToLocation(location)
	if err != nil {
		return nil, err
	}
	delErr := f.Delete()
	return newFile, delErr
}
func (f *File) MoveToFile(file vfs.File) error {
	if err := f.CopyToFile(file); err != nil {
		return err
	}
	return f.Delete()
}
func (f *File) Delete() error {
	f.writeBuffer = nil
	if err := f.Close(); err != nil {
		return err
	}
	handle, err := f.getObjectHandle()
	if err != nil {
		return err
	}
	return handle.Delete(f.fileSystem.ctx)
}