Gets the directory listing of the FTP server. Sends the NLST 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 the directory. @param[in] fPasv see documentation of CFTPClient::Passive
| 609 | /// @param[out] vstrFileList Returns a simple list of the files and folders of the specified the directory. |
| 610 | /// @param[in] fPasv see documentation of CFTPClient::Passive |
| 611 | bool CFTPClient::NameList(const tstring& strPath, TStringVector& vstrFileList, bool fPasv) const |
| 612 | { |
| 613 | COutputStream outputStream(mc_strEolCharacterSequence, CCommand::NLST().AsString()); |
| 614 | if( !ExecuteDatachannelCommand(CCommand::NLST(), strPath, CRepresentation(CType::ASCII()), fPasv, 0, outputStream) ) |
| 615 | return false; |
| 616 | |
| 617 | vstrFileList.clear(); |
| 618 | tstring strLine; |
| 619 | outputStream.SetStartPosition(); |
| 620 | while( outputStream.GetNextLine(strLine) ) |
| 621 | vstrFileList.push_back(strPath + strLine.c_str()); |
| 622 | |
| 623 | return true; |
| 624 | } |
| 625 | |
| 626 | /// Gets the directory listing of the FTP server. Sends the LIST command to |
| 627 | /// the FTP server. |
nothing calls this directly
no test coverage detected