[jamming] Automatic creation of target directories

Alen Ladavac alenl-ml at croteam.com
Thu May 10 04:40:19 PDT 2007


Ingo wrote:
> Since you have to locate your targets anyway, why don't you use MakeLocate,
> which also invokes MkDir?

Interesting notion. As we moved from the traditional approach where
each file is refered to only by its name, to a rooted tree for all
files in the workspace, and referring to them by full path, we dropped
MakeLocate along the way, because it didn't work. I actually have a
variant called MakeFileDir that works for files with paths, and that
works for multiple files, but I got sick of forgetting to write it
because the bug often appears at weird times, because some other files
sometimes create the dir in time, but of course, not always. So now
this patch makes me feel reliefed of "just one more thing to worry
about".

Anyway, I don't see a good reason for jam not to create those
directories before making the files, just as I don't see a good reason
for the system not to create the directory(es) when creating a file.
As a matter of fact, our in-house libraries do just that, and we don't
have to care whether the dir exists before creating a file.

FWIW,
Alen


More information about the jamming mailing list