In a presentation template, I sometimes have a need to write a short file out into a directory underneath /htdocs. The code works fine if the subdirectory already exists, but I'm having problems creating the directory automatically. The directories are automatically created by the workflow that automatically generates the file, but the directory isn't created until after the file is generated.
So I tried to write some PERL in the TPL that builds the directory underneath htdocs, but I'm getting weird errors and the permissions don't always get set right.
($current_dir = iwpt_get_dcr_name()) =~ s/(.*)\/templatedata\/(.*)\/data\/(.*)\/(.*)/$1\/htdocs\/$3/g;
if ((-d $current_dir) && (-w $current_dir)) {
} else {
if ($dcr_name eq "index") {
use File:

ath;
mkpath($current_dir);
chmod 0775, $current_dir;
}
}
This is on Solaris 8 with TeamSite 5.5.2; any thoughts?