func (a DbfsAPI) Create(path string, byteArr []byte, overwrite bool) (err error) {
	handle, err := a.createHandle(path, overwrite)
	if err != nil {
		return
	}
	defer func() {
		cerr := a.closeHandle(handle)
		if cerr != nil {
			err = cerr
		}
	}()
	buffer := bytes.NewBuffer(byteArr)
	for {
		byteChunk := buffer.Next(1e6)
		if len(byteChunk) == 0 {
			break
		}
		b64Data := base64.StdEncoding.EncodeToString(byteChunk)
		err = a.addBlock(b64Data, handle)
		if err != nil {
			return
		}
	}
	return
}
Create creates a file on DBFS
package storage
import (
	"bytes"
	"context"
	"encoding/base64"
	"github.com/databrickslabs/terraform-provider-databricks/common"
)
type FileList struct {
	Files []FileInfo `json:"files,omitempty"`
}
type FileInfo struct {
	Path     string `json:"path,omitempty"`
	IsDir    bool   `json:"is_dir,omitempty"`
	FileSize int64  `json:"file_size,omitempty"`
}
type CreateHandle struct {
	Path      string `json:"path,omitempty"`
	Overwrite bool   `json:"overwrite,omitempty"`
}
type Handle struct {
	Handle int64 `json:"handle,omitempty"`
}
type AddBlock struct {
	Data   string `json:"data,omitempty"`
	Handle int64  `json:"handle,omitempty"`
}
type ReadResponse struct {
	BytesRead int64  `json:"bytes_read"`
	Data      string `json:"data"`
}
func NewDbfsAPI(ctx context.Context, m interface{}) DbfsAPI {
	return DbfsAPI{m.(*common.DatabricksClient), ctx}
}
type DbfsAPI struct {
	client  *common.DatabricksClient
	context context.Context
}