MCPcopy Create free account
hub / github.com/SpartanJ/eepp / getDirectoryListing

Method getDirectoryListing

src/eepp/network/ftp.cpp:183–203  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

181}
182
183Ftp::ListingResponse Ftp::getDirectoryListing( const std::string& directory ) {
184 // Open a data channel on default port (20) using ASCII transfer mode
185 std::ostringstream directoryData;
186 DataChannel data( *this );
187 Response response = data.setup( Ascii );
188
189 if ( response.isOk() ) {
190 // Tell the server to send us the listing
191 response = sendCommand( "NLST", directory );
192
193 if ( response.isOk() ) {
194 // Receive the listing
195 data.receive( directoryData );
196
197 // Get the response from the server
198 response = getResponse();
199 }
200 }
201
202 return ListingResponse( response, directoryData.str() );
203}
204
205Ftp::Response Ftp::changeDirectory( const std::string& directory ) {
206 return sendCommand( "CWD", directory );

Callers

nothing calls this directly

Calls 3

setupMethod · 0.80
isOkMethod · 0.80
receiveMethod · 0.45

Tested by

no test coverage detected