lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


2013/3/4 albert <albert_200200@126.com>:
> I need to do such work in lua,
> 1、I need to get the directory file lists under a remote sftp server
> directory.
> 2、Download some files from the sftp server.
> 3、Upload some local files to the sftp server.
> How can I fulfill the need? Any advice would be kind.

If your system supports command-line sftp, the easiest is

function sftp(params,source,target)
  os.execute (("sftp %s %s %s"):format(params or "",source,target))
end