We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the bug I use the Walk method to get the file traversal, but can not get the file in the directory, but there are files in the directory
To Reproduce
file, err := os.Open(indexTableName) if err != nil { log.Println(fmt.Sprintf("open file failed, %s;", err)) } oldFileAbsPath := make(map[string]struct{}) scanner := bufio.NewScanner(file) for scanner.Scan() { line := scanner.Text() oldFileAbsPath[line] = struct{}{} } _ = file.Close() err = conn.Conn.ChangeDir(remoteFolderPath) if err != nil { oldFileAbsPath = nil return nil, errors.New(fmt.Sprintf("path failed:%s,:%s", remoteFolderPath, err)) } fileAbsPath := make(map[string]string) pathsSplit := strings.Split(remoteFolderPath, "/") walker := conn.Conn.Walk(remoteFolderPath) var builder strings.Builder for walker.Next() { info := walker.Stat() if info.Type.String() == "folder" { continue } if info == nil { continue } v := walker.Path() vSplit := strings.Split(path.Dir(v), "/") if len(vSplit)-1 > (len(pathsSplit)-1+folderLevel) && folderLevel > 0 && folderLevel != 0 { continue } builder.WriteString(v) builder.WriteRune('-') builder.WriteString(strconv.FormatUint(info.Size, 10)) builder.WriteRune('-') builder.WriteString(info.Time.Format("20060102150405")) m5 := builder.String() //m5 := v + "-" + strconv.FormatUint(info.Size, 10) + "-" + info.Time.Format("20060102150405") if _, ok := oldFileAbsPath[m5]; !ok { fileAbsPath[v] = m5 } builder.Reset() } if err = walker.Err(); err != nil { log.Println(fmt.Sprintf("path failed:%s,:%s", remoteFolderPath, err)) } oldFileAbsPath = nil
FTP server
Additional context Is it related to the file system string?
Looking forward to reply! 🤣
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Describe the bug
I use the Walk method to get the file traversal, but can not get the file in the directory, but there are files in the directory
To Reproduce
FTP server
Additional context
Is it related to the file system string?
Looking forward to reply! 🤣
The text was updated successfully, but these errors were encountered: