Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Inet ftp control problem with DIR command

Status
Not open for further replies.

jb13

Programmer
Oct 12, 2006
11
CA
Hi everyone,

I got a strange bug with my program while trying to get the file list of an ftp directory. Just look at the code first:
Code:
FTP.Execute , "CD /images/"
Do
    DoEvents
    Sleep 150
Loop Until Not FTP.StillExecuting
    
FTP.Execute , "DIR"
Do
    DoEvents
    Sleep 150
Loop Until Not FTP.StillExecuting

I go to the image directory, no problem with this operation. Than I execute a DIR command on the directory to get the file list, here a strange thing happen.

When I execute the code with no break point, or with the compiled exe, it goes to an infinite loop.

But if i use the vb debugger and just press "stop" and "go" while in the loop, it exits the loop and all work fine.

Does someone have an idea of what is happening there ? Because it looks very strange to me.

Thank you
 
Just in case it could interest someone who have the same case, i resolved the problem by reducing the Sleep to 1.
 
Because if i don't sleep the loop is too fast and the processor goes at 100%
 
Have a look at thread222-1126722.

I hope this helps.

Ron Repp

If gray hair is a sign of wisdom, then I'm a genius.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top