Re: Method similler to File.Exists() for this comp - WeOnlyDo Discussion board

Re: Method similler to File.Exists() for this comp (General questions)

by wodDamir, Thursday, October 09, 2008, 09:00 (5888 days ago) @ pp

Hi,

Ok, ListDir is used by simply providing is remotepath. Something like this:

[code]wodFtp1.ListDir /home/user/ [/code]

This method will list all the files and directories in that path. Also, as a result it will fire ListItems event,which will provide you directory listing as String.

More information here: http://www.weonlydo.com/FtpDLX/Help/wodFtpDLXLib~wodFtpDLX~ListItems_EV.html

As a result of ListDir method, DirItems collection is also populated with all the files/directories. You can then iterate thru each of them, something like this:

[code]Dim folderItem as DirItem
For each folderItem in wodFtp1.DirItems
Debug.Print folderItem.Name
Next[/code]


LoopFiles also accepts remotepath parameter. However, as a result of this method, LoopItem event is fired for each item (directory, file etc.). Using this event, you can use RemoteFile parameter to check if this is the file you are looking for.

You can find more information on this event here: http://www.weonlydo.com/FtpDLX/Help/wodFtpDLXLib~wodFtpDLX~LoopFiles.html

Hope this helps.

Regards,
Damba


Complete thread: