// Run used to func (r *Rout) Run(path string) core.RoutineChan { t := tool.NewTFile(path) // r.T = t return t }
// Run used to func (r *RoutEx) Run(path string) core.RoutineChan { tmp := []rune(path) fileR := string(tmp[0:len(path)-len(".left")]) + ".right" t := tool.NewTFile(fileR) fmt.Printf(".....%v\n", fileR) if t == nil { return r } d := new(EXData) d._mapR = r.loadMap(t) t = tool.NewTFile(path) d._mapL = r.loadMap(t) // r.T = d return d }
// InitDict used to init Idcsv._dict func (obj *Idcsv) InitDict(path string) { dir := new(tool.DirInfo) if dir.InitDir(path) != nil { return } obj._inited = true if obj._dict == nil { obj._dict = make(map[string]*tool.Item) } ci := make(chan *tool.TFile) cnt := 0 for { name := dir.NextFile() if name == nil { break } cnt++ go func() { file := tool.NewTFile(*name) // fmt.Printf(">>>>>>%v\n", *name) ci <- file }() // file := tool.NewTFile(*name) // if file != nil { // obj.load(file) // } } L: for { select { case t := <-ci: if t != nil { obj.load(t) } else { fmt.Println("--=-=-=-=-=-=") } cnt-- if cnt < 1 { break L } } } fmt.Printf("-----%v\n", len(obj._dict)) }