Gets the directory listing of the FTP server. Sends the LIST command to the FTP server. @param[in] strPath Starting path for the list command. @param[out] vstrFileList Returns a simple list of the files and folders of the specified directory. @param[in] fPasv see documentation of CFTPClient::Passive
| 589 | /// @param[out] vstrFileList Returns a simple list of the files and folders of the specified directory. |
| 590 | /// @param[in] fPasv see documentation of CFTPClient::Passive |
| 591 | bool CFTPClient::List(const tstring& strPath, TStringVector& vstrFileList, bool fPasv) const |
| 592 | { |
| 593 | COutputStream outputStream(mc_strEolCharacterSequence, CCommand::LIST().AsString()); |
| 594 | if( !ExecuteDatachannelCommand(CCommand::LIST(), strPath, CRepresentation(CType::ASCII()), fPasv, 0, outputStream) ) |
| 595 | return false; |
| 596 | |
| 597 | vstrFileList.clear(); |
| 598 | tstring strLine; |
| 599 | outputStream.SetStartPosition(); |
| 600 | while( outputStream.GetNextLine(strLine) ) |
| 601 | vstrFileList.push_back(strPath + strLine.c_str()); |
| 602 | |
| 603 | return true; |
| 604 | } |
| 605 | |
| 606 | /// Gets the directory listing of the FTP server. Sends the NLST command to |
| 607 | /// the FTP server. |
no test coverage detected