Fixed ftpclient.createDir.

This commit is contained in:
dom96
2011-11-29 18:54:24 +00:00
parent 59543ef0a3
commit 710ee8c67d

View File

@@ -222,9 +222,12 @@ proc createDir*(ftp: var TFTPClient, dir: string, recursive: bool = false) =
assertReply ftp.send("MKD " & dir), "257"
else:
var reply = TaintedString""
var previousDirs = ""
for p in split(dir, {os.dirSep, os.altSep}):
if p != "":
reply = ftp.send("MKD " & p)
previousDirs.add(p)
reply = ftp.send("MKD " & previousDirs)
previousDirs.add('/')
assertReply reply, "257"
proc list*(ftp: var TFTPClient, dir: string = "", async = false): string =