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