Exemplo n.º 1
0
func changeGroup(fs *gowfs.FileSystem, hdfsPath string) {
	shell := gowfs.FsShell{FileSystem: fs}
	_, err := shell.Chgrp([]string{hdfsPath}, "superduper")
	if err != nil {
		log.Fatal("Chgrp failed for ", hdfsPath, ": ", err.Error())
	}
	stat, err := fs.GetFileStatus(gowfs.Path{Name: hdfsPath})
	if err != nil {
		log.Fatal("Unable to validate chgrp() operation: ", err.Error())
	}
	if stat.Group == "superduper" {
		log.Println("Chgrp for ", hdfsPath, " OK ")
		ls(fs, hdfsPath)
	} else {
		log.Fatal("Chgrp() failed.")
	}
}