Esempio n. 1
0
func generateSampleFolderFile() {
	ps := physical.New()
	ps["001"] = physical.Folder{Path: "C:\\temp", AuthorizedMails: map[string]bool{"*****@*****.**": true, "*****@*****.**": true}}
	ps["001"].ID = "001"
	ps["001"].Name = "temp"

	ps["002"] = physical.Folder{Path: "D:\\temp\\pic", AuthorizedMails: map[string]bool{"*****@*****.**": true, "*****@*****.**": true}}
	ps["002"].ID = "002"
	ps["002"].Name = "pic"

	file, err := os.Create("/home/MINDFLAVOR/mindflavor/shared_folders.json")
	if err != nil {
		panic(err)
	}

	ps.Save(file)
	file.Close()
}
Esempio n. 2
0
func main() {
	root := os.Args[1]
	outfile := os.Args[2]
	id = 0

	autMails = make(map[string]bool)
	for _, item := range os.Args[3:] {
		autMails[item] = true
	}

	pfs = physical.New()

	_, rootName = filepath.Split(root)

	addFolder(root, root)

	file, err := os.Create(outfile)
	if err != nil {
		panic(err)
	}
	defer file.Close()

	pfs.Save(file)
}