Skip Menu |

This queue is for tickets about the Template-Toolkit CPAN distribution.

Report information
The Basics
Id: 38076
Status: resolved
Worked: 3 min
Priority: 0/
Queue: Template-Toolkit

People
Owner: Nobody in particular
Requestors: brooks [...] deseret.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: ttree - needs binmode()
Date: Thu, 31 Jul 2008 11:32:39 -0400
To: bug-Template-Toolkit [...] rt.cpan.org
From: Lyle Brooks <brooks [...] deseret.com>
While porting my TT2 application to a Windows environment, I found that ttree was mangling my data (which worked fine in a Linux environment). With in ttree, in the method process_file() Here is the code snippet... 389 # process file 390 unless ($dryrun) { 391 $template->process($file, $replace, $destfile) 392 || print(" ! ", $template->error(), "\n"); 393 394 if ($preserve) { 395 chown($uid, $gid, $dest) || warn "chown($dest): $!\n"; 396 chmod($mode, $dest) || warn "chmod($dest): $!\n"; 397 } 398 } I changed line 391 to read 391 $template->process($file, $replace, $destfile, { binmode => 1} ) and this seemed to correct the problem, but may need to be regression tested.
On Thu Jul 31 11:34:27 2008, brooks@deseret.com wrote: Show quoted text
> I changed line 391 to read > > 391 $template->process($file, $replace, $destfile, { binmode > => 1} )
Patch applied, thanks Lyle. A
On Wed Aug 06 03:35:06 2008, ABW wrote: Show quoted text
> Patch applied, thanks Lyle.
I just found this patch which adds it as a binmode configuration option so I've changed it to use that. http://rt.cpan.org/Ticket/Display.html?id=30760 Cheers A