hi all,
i am new to this group. hope get maximum benifit out of this group.
currently i am writting a script wherein i hav to creat a temporary file in
each sub directory starting from main dir and write in to that file
i hav to expand each make file within each sudirectory and place that temp file
there itself
i tried following
sub1{
......
$path=$mainpath.$tempfile
open(FD,">$path")
printfile($path,*FD);
....
}
sub printfile{
$fileloc=SHIFT
$filpediscriptor=SHIFT;
here i cal a readfile routine which returns me the contents of file in array @lines
for each line($line) in array i do the following
for( for ech $line of @lines){
check if it contains include stmt if so {
get that include file loc and pass it to printfilesubroutin
printfile($includefileloc , *$filpediscriptor);
}
else
{
write content of makefile to temp file creatred in each subdirectory
print $filediscriptor , $line
}
close($filediscriptor);
}
the probleem here the temporary file created in each subfolder is not complete it
is truncated.
am passing the file discriptor currectly in recursive subroutine
i thank u all in advance
regards
sid
---------------------------------------------------------------------------------------------------------------------------------
"There is nothing in a caterpillar that tells you it's going to be a butterfly." -
Anonymous