Gets a file listing for a remote folder and returns a collection of objects with the following properties:
- FileAttribute (16 - directory, 128 - file)
You can use this method instead of
aFtpDir() of the base class, which is not supported by this SFPT implementation.
Make sure a connection is open by calling
FtpConnect() before using this and other low level operations.
Collection of file objects or null
The path on the server to return files for. Pass an empty string for the current active folder. Note it doesn't work with wildcards or filespecs only folder names.
loFtp = CREATEOBJECT("wwFtp") loFtp.cFtpServer = "west-wind.com" loFtp.nFtpPort = 23 loFtp.cUsername = "tester" loFtp.cPassword = "password" loFtp.FtpConnect() *** List files in active folder loFiles = loFtp.FtpListFiles("") && or: "/subfolder" or "subfolder2" (relative) loFtp.FtpClose() this.AssertTrue(!ISNULL(loFiles),loFtp.cErrorMsg) FOR EACH loFile IN loFiles FOXOBJECT ? loFile.Name + " - " +; TRANSFORM(loFile.Length) + " - " +; TRANSFORM(loFile.FileAttribute) + " - " +; TRANSFORM(loFile.LastWriteTime) ENDFOR
See also:Class wwSFTP
Comment or report problem with topic