[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb: [1938] branches/1.2/LedgerSMB/AM.pm



Revision: 1938
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=1938&view=rev
Author:   tetragon
Date:     2007-12-04 12:00:43 -0800 (Tue, 04 Dec 2007)

Log Message:
-----------
Encoding fixes for the backup routines

Modified Paths:
--------------
    branches/1.2/LedgerSMB/AM.pm

Modified: branches/1.2/LedgerSMB/AM.pm
===================================================================
--- branches/1.2/LedgerSMB/AM.pm	2007-12-03 09:06:51 UTC (rev 1937)
+++ branches/1.2/LedgerSMB/AM.pm	2007-12-04 20:00:43 UTC (rev 1938)
@@ -1615,7 +1615,7 @@
 "${LedgerSMB::Sysconfig::backuppath}/$boundary.$globalDBname-$form->{dbversion}-$t[5]$t[4]$t[3].sql";
     $form->{OUT} = "$tmpfile";
 
-    open( OUT, '>', "$form->{OUT}" ) or $form->error("$form->{OUT} : $!");
+    open( OUT, '>:raw', "$form->{OUT}" ) or $form->error("$form->{OUT} : $!");
 
     # get sequences, functions and triggers
 
@@ -1649,8 +1649,9 @@
 
     if ( $form->{media} eq 'file' ) {
 
-        open( IN, '<', "$tmpfile" ) or $form->error("$tmpfile : $!");
+        open( IN, '<:raw', "$tmpfile" ) or $form->error("$tmpfile : $!");
         open( OUT, ">-" ) or $form->error("STDOUT : $!");
+        binmode( OUT, ':raw' );
 
         print OUT qq|Content-Type: application/file;\n|
           . qq|Content-Disposition: attachment; filename="$myconfig->{dbname}-$form->{dbversion}-$t[5]$t[4]$t[3].sql$suffix"\n\n|;


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.