Query on DzDir
Richard Haseltine
Posts: 100,939
I was just trying to write a routine to ensure a path existed, and thought to use DzDir to check for existence and walk up the tree if not (using a recursive function) until hit a real folder at which I could walk back down again creating the needed folders. DzDir.cdUp() works if DzDir is itself pointing to a non-existent directory, but not if the parent directory is also non-existent. I've got round the problem by manually truncating the path as a string, but is that the way cdUp() should be behaving? If not I'll bug report it.
Comments
Ensuring that a path exists is actually much easier than that... see below.
DzDir is basically just a wrapper for [an earlier version of]* QDir. So QDir::cdUp() describes the expected behavior.
*Its been a while since the wrapper was updated to provide script access to some of the newer functions you'll notice in the Qt docs.
-Rob
Ah, thank you - that probably means I don't even need a separate function. My excuse is that I am not yet used to these glasses.