I inherited a project at work and at a certain point I’m supposed to send (recursively) a folder and its content to a ftp server using QFtp (connected with signals and slots).
This works perfectly okay except that if I try to create a destination directory :
m_pFtp->mkdir(sRemoteFullPath);
and that directory already exist, all subsequent commands won’t execute (all the put() and other mkdir() for deeper folders that already have been ‘started’).
I do catch the error but all other commands are discarded and not carried out (if I debug-jump the mkdir() when I know the folder exists, everything works fine).
So my question is, is there a way to :
A) Ignore this ‘error’ (“Creating directory failed: Directory already exixts”)?
or
B) Somehow only create the directory if it doesn’t exist?
I know that I can do it ‘the long way’, ie. scanning the whole subfolder structure on the server and act accordingly but a simpler solution would be both faster (to code) and in my opinion neater 🙂
Thanks!
ps. I’m using WinXP, Qt and Filezilla server.
After some looking, it seems the “Long Way” is in fact the way everyone recommends.