funcdealWebdir(confreadfile.Config,pathstring,webfile[]readfile.Ruledata,webfile_white[]readfile.Ruledata) {
files, _ := ioutil.ReadDir(path)
skip_slice := strings.Split(conf.Webfile_skip,"|")
var stat int = 0
for _, file := range files {
fmt.Println(file.Name())
if file.IsDir() {
fmt.Println(file.Name())
dealWebdir(conf,path+"/" + file.Name(),webfile,webfile_white)
} else {
//对文件进行处理
//fmt.Println(myfolder + "/" + file.Name(),"mode:",file.Mode(),"size:",file.Size(),"modetime:",file.ModTime)
for _,value := range skip_slice{
if strings.HasSuffix(strings.ToUpper(file.Name()), strings.ToUpper(value)){
stat = 1
}
}
if stat == 0{
dealWebfile(conf,file,path,webfile,webfile_white)
}else{
//fmt.Println("path:",path,"skip--",file.Name())
stat = 0
}
}
}
Do not ignore the errors. Check the error from ioutil.ReadDir and see what it is. If your path is relative, it might matter where the exe is or how it’s run. If the error doesn’t make sense, we can perhaps help.
I’m not sure about the folder application data, but many of the default folders of a windows installation are heavily restricted. Try one you know even a guest account should be able to read.
Edit
Also please copy and paste the output rather than screenshotting it. Screenshots are hard to follow on my mobile with reduced data plan due to reaching quota very early this month…
But what I’d like to know most about F: disk is that it reads directly to the directory where the EXE file resides, rather than traversing the F: directory as a whole.