获取指定目录下的子文件列表 package main import "fmt" import "io/ioutil" func main() { dir_list, e := ioutil.ReadDir("C:/Documents and Settings/xxx/Desktop/Copy of change-sub") if e != nil { fmt.Println("read dir error") return } for i, v := range dir_list { fmt.Println(i, "=", v.Name()) } }
时间: 2024-11-03 22:51:46