You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I also encountered similar problems on Kylin OS.
Kylin OS return dirTimeFormat is "02 01月 2006 15:04" when using LIST function
So I added a new time parse in parse.go file
func (e *Entry) setTime(fields []string, now time.Time, loc *time.Location) (err error) {
if strings.Contains(fields[2], ":") { // contains time
thisYear, _, _ := now.Date()
timeStr := fmt.Sprintf("%s %s %d %s", fields[1], fields[0], thisYear, fields[2])
e.Time, err = time.ParseInLocation("_2 Jan 2006 15:04", timeStr, loc)
// added code
if err != nil{
layout := "02 01月 2006 15:04"
e.Time, err = time.ParseInLocation(layout, timeStr, loc)
}
// xxxxx
}
}
This appears to have been fixed in #354 but no new release has been created. Should work with pseudo modules by doing go get github.com/jlaffaye/ftp@master to pull in the latest master commit.
Describe the bug
I'm using the
List
function with a FTP server that returns a line like this:When debugging the
parseDirListLine
function, it doesn't recognize the dirTimeFormat.To Reproduce
A program like this:
Expected behavior
It returns and prints the directory as entry.
FTP server
Suggested solution
I think it could be fixed by adding
01-02-2006 03:04PM
to thedirTimeFormats
inparse.go
.The text was updated successfully, but these errors were encountered: