Loosing directories

<[email protected]>
Newsgroups gmane.comp.lang.perl.modules.template-toolkit
Message-ID <[email protected]>
Hi,

I'm using template toolkit to genereate configuration-files for an application. The way it works is that I have all templates in the same structure like the application directory under a directory called templates.

The funny thing is, that for one directory (called interfaceTools) it deletes the directory and only puts the templates in (i.e. all other files are gone after running template toolkit). The same works without problems on other directories. I could not fine anything special about the directory.

Here's the code:

      $logger->debug("Creating config-files on ".$self->get_environment);
      $logger->debug("on host ".$self->get_mainHost);
      $logger->debug("in directory ".$self->get_appDir);
      $logger->debug("for binary ".$self->get_Version);

      my $tt = Template->new({
         INCLUDE_PATH => '../templates/'.$self->get_Version,
         INTERPOLATE  => 1,
         RELATIVE => 1,
      }) || $logger->logdie("Cannot execute template");

      my $all_files = File::Finder->type('f');
      my @templates=$all_files->in('../templates/'.$self->get_Version);
      my $errors=0;
      foreach my $t (@templates) {
             my $destDir=$self->get_appDir."/";
             my $tOut=$destDir.substr($t,length('../templates/'.$self->get_Version)+1);
             my $tOutOrig;
             if ($args{check}) {$tOutOrig=$tOut;
                                    $tOut=$tOut.".cmp";

           }
             $logger->debug("Processing template: $t / $tOut");
           $tt->process($t , $self, $tOut) || $logger->logdie($tt->error);
      }


Before:
=======

drwxr-x---   4 murex    murex        512 Aug 19  2008 markit
drwxr-x---   2 murex    murex        512 May  8  2010 bloomberg
drwxr-x---   2 murex    murex        512 May 14  2011 markit-equity
drwxr-x---   6 murex    murex       1024 Oct 31 09:45 realtime
drwxr-x---   5 murex    murex        512 Nov  3 08:00 fixing

After:
======

drwxr-x---   2 murex    murex        512 Nov 11 16:05 fixing
drwxr-x---   2 murex    murex        512 Nov 11 16:05 realtime

-rwxr-xr-x   1 murex    murex       3345 Nov 11 16:05 rtbsrfa.sh (This file comes from the template)

Any ideas?

Many thanks and have a good weekend,
Markus





-----------------------------------------------------------------
ATTENTION:
The information in this electronic mail message is private and
confidential, and only intended for the addressee. Should you
receive this message by mistake, you are hereby notified that
any disclosure, reproduction, distribution or use of this
message is strictly prohibited. Please inform the sender by
reply transmission and delete the message without copying or
opening it.

Messages and attachments are scanned for all viruses known.
If this message contains password-protected attachments, the
files have NOT been scanned for viruses by the ING mail domain.
Always scan attachments before opening them.
-----------------------------------------------------------------

_______________________________________________
templates mailing list
[email protected]
http://mail.template-toolkit.org/mailman/listinfo/templates
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.