Re: Query on FTP commands - WeOnlyDo Discussion board

Re: Query on FTP commands (General questions)

by wodSupport, Wednesday, September 01, 2004, 11:52 (7389 days ago) @ 2BS

2BS

But how do I check if a directory exists? At present I just go to >that directory, and if it fails, then it doesn't exist. Not >airtight I know (because it may be security reasons, and not that >it doesn't exist).

You cannot do it. Try to get ListDir from it. If it doesn't exist, you will get an error.

Is it thread safe? i.e. can I have multiple threads each with their own instance of the FTP component?

Yes it is, but it is very important that you use one instance from (and only from!) the same thread where you initialized it. It is apartment-threaded. You can have any number of threads, each of them having one instance of wodFtpDLX. That will work.

If the connection is dropped, and I reconnect, is the DirList property cleared? It's important to me that it isn't - strange request I know, but it'd take a long time to explain why

Yes it is. Each time ListDir is requested, DirItems property is cleared so it can accept new results. Why do you ask, did you notice different behavior?

Regards,
Kreso


Complete thread: