func save() {
	data, err := json.MarshalIndent(backups, "", " ")
	if err != nil {
		fmt.Println(err)
		return
	}
	err = ioutil.WriteFile(fmt.Sprintf("%s/%s", basedir, filename), data, os.FileMode(0700))
	if err != nil {
		fmt.Println(err)
		return
	}
}
save upload details into the flatfile
package main
import (
	"encoding/json"
	"fmt"
	"io/ioutil"
	"log"
	"os"
	"os/user"
	"github.com/peoples-cloud/pc/crypto"
	"github.com/peoples-cloud/pc/ipfs"
	"github.com/peoples-cloud/pc/tar"
	"github.com/spf13/cobra"
)
type BackupEntry struct {
	Hash string
	Key  string
	Note string
}
var backups = make(map[string][]BackupEntry)
var basedir string
var filename = ".piratcloud"
var note string