This operation is done by a Task asynchronously (other Tasks will be executed concurrently without blocking execution flow)
Ftp:removefile(path)
Removes the specified file from the FTP server.
Parameters
path
A string that contains the name of the directory to be removed. This can be either a fully qualified path or a name relative to the current FTP directory.
Return value
This method return a Task instance. Once the Task has finished, it will return a
boolean
value indicating if the operation was successful.
Example
local net = require "net"
-- connect to the FTP server
local url = "your ftp server"
local client = net.Ftp(url, "username", "password")
-- remove file "/test.txt"
if await(client:removefile("/test.txt")) then
print("Successfully removed FTP file '/test.txt'")
else
error(net.error)
end