Ftp & Nlst

Montie

Member
Joined
Feb 16, 2004
Messages
15
Hello!

I have a problem with an ftp class. When I say "give me the list of files on FTP remote folder", it gets me only a part of them. Code:

Code:
        SendCommand("NLST " & sMask)

        If (Not (m_iRetValue = 150 Or m_iRetValue = 125)) Then
            MessageString = m_sReply
            Throw New IOException(m_sReply.Substring(4))
        End If

        m_sMes = ""
        Do While (True)
            m_aBuffer.Clear(m_aBuffer, 0, m_aBuffer.Length)
            bytes = cSocket.Receive(m_aBuffer, m_aBuffer.Length, 0)
            m_sMes += ASCII.GetString(m_aBuffer, 0, bytes)

            If (bytes < m_aBuffer.Length) Then
                Exit Do
            End If
        Loop

If I just execute this, I get only a part of the list (some 50 files out of 120something). If I debug and go line per line, I get all files :confused: .

Can anyone help?

Thanks in advance
 
Back
Top