MCPcopy Create free account
hub / github.com/SFML/SFML / getDirectoryListing

Method getDirectoryListing

src/SFML/Network/Ftp.cpp:230–251  ·  view source on GitHub ↗

///////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

228
229////////////////////////////////////////////////////////////
230Ftp::ListingResponse Ftp::getDirectoryListing(const std::string& directory)
231{
232 // Open a data channel on default port (20) using ASCII transfer mode
233 std::ostringstream directoryData;
234 DataChannel data(*this);
235 Response response = data.open(TransferMode::Ascii);
236 if (response.isOk())
237 {
238 // Tell the server to send us the listing
239 response = sendCommand("NLST", directory);
240 if (response.isOk())
241 {
242 // Receive the listing
243 data.receive(directoryData);
244
245 // Get the response from the server
246 response = getResponse();
247 }
248 }
249
250 return {response, directoryData.str()};
251}
252
253
254////////////////////////////////////////////////////////////

Callers 2

mainFunction · 0.45
mainFunction · 0.45

Calls 3

openMethod · 0.45
isOkMethod · 0.45
receiveMethod · 0.45

Tested by

no test coverage detected