Web Connection
Class wwSFTP
You can check the File Attribute for a value of 16. I've also added a new property IsDirectory
for future releases.
https://webconnection.west-wind.com/docs/_4tc1eh7o5.htm
For now this code works:
loFtp = CREATEOBJECT("wwFtp")
loFtp.cFtpServer = "test.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
IF loFileAttribute == 16
? "It's a directory"
ELSE
? "It's a file"
ENDIF
ENDFOR
+++ Rick ---