cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
Check if file exists on FTP-server
Check if file exists on FTP-server
Dec 21, 2014 at 6:35pm UTC
Nielyboyken
(153)
Hello
I want to check if a file exists on a FTP server, but I have no clue how I can begin with this.
I tried this method:
http://www.example-code.com/vcpp/ftp_fileExists.asp
But for that I again need an extra library, which I don't want.
In my project I'm using the SFML Library, someone suggested me the 'DirectoryListing'-method:
http://www.sfml-dev.org/documentation/2.0/classsf_1_1Ftp_1_1ListingResponse.php
http://www.sfml-dev.org/tutorials/2.0/network-ftp.php
But that code didn't worked, I don't understand it, and I don't know what vectors are.
Someone knows how to check if a file exists on a FTP-server? With or without SFML?
Thanks for reading,
Niely
Dec 22, 2014 at 3:42pm UTC
Nielyboyken
(153)
Someone able to help? :/
Dec 22, 2014 at 5:13pm UTC
norm b
(337)
Similar to the code in the first link of your post, where if checking for the file size fails the file doesn't exist, you could use sf::Ftp::renameFile(). Pass the file name you are checking for as both parameters and test response.isOk().
Dec 26, 2014 at 2:56pm UTC
Nielyboyken
(153)
^Thanks, that worked awesome and exactly what I needed. :)
Topic archived. No new replies allowed.