Developer forums (C::B DEVELOPMENT STRICTLY!) > Development
[BUG]: "Directory cannot be created" error if directory is present
thomas:
The "early out" feature in CreateDirRecursively was first added in 3193 (with return value == failed) and amended in 3206 (with correct return value).
What "early out" does is abort if the requested directory already exists, instead of checking the root directory and then hangling through the entire FS hierarchy until failing in the very end.
The "early out" code is nothing but:
--- Code: --- if(wxDirExists(full_path)) // early out
return true;
--- End code ---
So, in other words, "early out" does what you should have done in wiz.cpp in the first place. No special magic happens. If the path exists, then the function returns immediately (success). If it does not exist, the function attempts to create it in the same way it has been doing for years (success if the folder can be created, failure otherwise).
By the way, CreateDirRecursively has a wxLogNull object, so I don't see how this function could produce a "could not create directory" warning, as these are discarded.
MortenMacFly:
--- Quote from: thomas on November 15, 2006, 06:38:46 pm ---By the way, CreateDirRecursively has a wxLogNull object, so I don't see how this function could produce a "could not create directory" warning, as these are discarded.
--- End quote ---
Sure it didn't - the error message was raised by wiz.cpp (as I said earlier... ;-)).
Anyway - after a SVN update this issue was fixed. Seems as if I had missed the one update that took care of this... :oops:
So... erm... Sorry for the noise. ;-)
With regards, Morten.
Navigation
[0] Message Index
[*] Previous page
Go to full version