classes/CFTP.cpp
std::uint16_t CFTP::listFile(const std::string &filePath, std::string &listOutput)
    {
        try
        {
            if (!m_connected)
            {
                throw std::logic_error("Already connected to a server.");
            }
            listOutput.clear();
            ftpCommand("MLST " + filePath);
            if (m_commandStatusCode == 250)
            {
                listOutput = m_commandResponse.substr(m_commandResponse.find('\n') + 1);
                listOutput = listOutput.substr(0, listOutput.find('\r'));
            }
            return (m_commandStatusCode);
        }
        catch (const std::exception &e)
        {
            throw Exception(e.what());
        }
    }
//
// Produce file information for the file passed in or for the current
// working directory if none is. Note: Reply is sent on control and not
// the data channel.
//
Produce file information for the file passed in or for the current
working directory if none is. Note: Reply is sent on control and not
the data channel.
Produce file information for the file passed in or for the current working directory if none is . Note : Reply is sent on control and not the data channel .
std::uint16_t CFTP::listFile(const std::string &filePath, std::string &listOutput)
    {
        try
        {
            if (!m_connected)
            {
                throw std::logic_error("Already connected to a server.");
            }
            listOutput.clear();
            ftpCommand("MLST " + filePath);
            if (m_commandStatusCode == 250)
            {
                listOutput = m_commandResponse.substr(m_commandResponse.find('\n') + 1);
                listOutput = listOutput.substr(0, listOutput.find('\r'));
            }
            return (m_commandStatusCode);
        }
        catch (const std::exception &e)
        {
            throw Exception(e.what());
        }
    }
std :: uint16_t CFTP :: listFile ( const std :: string & filePath , std :: string & listOutput ) { try { if ( ! m_connected ) { throw std :: logic_error ( " " ) ; } listOutput . clear ( ) ; ftpCommand ( " " + filePath ) ; if ( m_commandStatusCode == 250 ) { listOutput = m_commandResponse . substr ( m_commandResponse . find ( ' \n ' ) + 1 ) ; listOutput = listOutput . substr ( 0 , listOutput . find ( ' \r ' ) ) ; } return ( m_commandStatusCode ) ; } catch ( const std :: exception & e ) { throw Exception ( e . what ( ) ) ; } }
Produce file information for the file passed in or for the current
working directory if none is.
Produce file information for the file passed in or for the current working directory if none is .