Ftp:command(cmd, [response])method
Sends and executes the provided command to the FTP server.
Parameters
cmd
A string that contains the command to execute.
[response]
An optional boolean value indicating if the Task should wait for a response.
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
--! luart-extensions
import net
-- connect to the FTP server
local url = "your ftp server"
local client = net.Ftp(url, "username", "password")
-- Execute the LIST command
if await(client:command("LIST /")) then
print("LIST command result :")
else
error(net.error)
end