Fixed ftpclient.createDir.
This commit is contained in:
parent
59543ef0a3
commit
710ee8c67d
1 changed files with 4 additions and 1 deletions
|
|
@ -222,9 +222,12 @@ proc createDir*(ftp: var TFTPClient, dir: string, recursive: bool = false) =
|
||||||
assertReply ftp.send("MKD " & dir), "257"
|
assertReply ftp.send("MKD " & dir), "257"
|
||||||
else:
|
else:
|
||||||
var reply = TaintedString""
|
var reply = TaintedString""
|
||||||
|
var previousDirs = ""
|
||||||
for p in split(dir, {os.dirSep, os.altSep}):
|
for p in split(dir, {os.dirSep, os.altSep}):
|
||||||
if p != "":
|
if p != "":
|
||||||
reply = ftp.send("MKD " & p)
|
previousDirs.add(p)
|
||||||
|
reply = ftp.send("MKD " & previousDirs)
|
||||||
|
previousDirs.add('/')
|
||||||
assertReply reply, "257"
|
assertReply reply, "257"
|
||||||
|
|
||||||
proc list*(ftp: var TFTPClient, dir: string = "", async = false): string =
|
proc list*(ftp: var TFTPClient, dir: string = "", async = false): string =
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue