Hi
Need your input on the following
Task) Need to regenerate all html's in a given directory(including sub directory's) whenever the user previews or generates any one DCR.
Let me explain in a bit more detiled manner
say you have two dcr a.dcr and b.dcr and one common.tpl , now you generate two pages from a.dcr say a1.html and a2.html .
Now after generating a1.html and a2.html from a.dcr we make more changes to the dcr and saves it without regenaring.
Now we open the second dcr b.dcr and generate/preview the page. Now while the user is previewing/genating using the second b.dcr we need to regenarte all the pages generated using the first dcr as well.
This is the Solution which i wrote inside the tpl)
@files_list= system(" ls -R "Full path of the directory " | grep /");
foreach $k (
@files_list){
$k=~ s/://g;
chomp($k);
$k=$k."/*.html";
$cmd="$iwhome/bin/iwregen $k";
`$cmd`;
}
Issue ) The above code works, But the problem is the page dosent load easily, The time taken to preview or generate a page is very high. The given directory has around 100 test pages. most of the time when i try to preview the page it waits and waits till it finally times out.
BTW this code need to work on solaris / and not on windows ,so we have the liberty of writing system(ls ...);
Any suggestions ?