mirror of
https://github.com/nim-lang/Nim.git
synced 2026-06-04 19:04:46 +00:00
Asyncftpclient: adding removeDir proc
This commit is contained in:
@@ -354,6 +354,10 @@ proc store*(ftp: AsyncFtpClient, file, dest: string,
|
||||
|
||||
await doUpload(ftp, destFile, onProgressChanged)
|
||||
|
||||
proc removeDir*(ftp: AsyncFtpClient, dir: string) {.async.} =
|
||||
## Delete a directory ``dir`` on the remote FTP server
|
||||
assertReply(await ftp.send("RMD " & dir), "250")
|
||||
|
||||
proc newAsyncFtpClient*(address: string, port = Port(21),
|
||||
user, pass = ""): AsyncFtpClient =
|
||||
## Creates a new ``AsyncFtpClient`` object.
|
||||
@@ -373,6 +377,8 @@ when not defined(testing) and isMainModule:
|
||||
echo await ftp.listDirs()
|
||||
await ftp.store("payload.jpg", "payload.jpg")
|
||||
await ftp.retrFile("payload.jpg", "payload2.jpg")
|
||||
await ftp.createDir("deleteme")
|
||||
await ftp.removeDir("deleteme")
|
||||
echo("Finished")
|
||||
|
||||
waitFor main(ftp)
|
||||
|
||||
Reference in New Issue
Block a user