[Bio] / FigWebServices / ss_export.cgi Repository:
ViewVC logotype

Diff of /FigWebServices/ss_export.cgi

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2, Thu May 27 17:19:05 2004 UTC revision 1.5, Thu May 27 19:28:08 2004 UTC
# Line 54  Line 54 
54      chdir($tmp);      chdir($tmp);
55    
56      #      #
57        # Write a README with the mapping from genome and role index to name.
58        #
59    
60        open(my $rfh, ">README");
61    
62        print $rfh "Roles\n";
63        for my $role (@roles)
64        {
65            my $name = $sub->get_role($role);
66            my $abbr = $sub->get_role_abbr($role);
67    
68            print $rfh "$role\t$abbr\t$name\n";
69        }
70    
71        print $rfh "\n";
72    
73        print $rfh "Genomes\n";
74    
75        for my $g (@genomes)
76        {
77            my $gname = $sub->get_genome($g);
78            my $gs = $fig->genus_species($gname);
79    
80            print $rfh "$g\t$gname\t$gs\n";
81        }
82        close($rfh);
83    
84        #
85      # Write the role exports.      # Write the role exports.
86      #      #
87    
# Line 133  Line 161 
161      close($all_fh);      close($all_fh);
162      close($allprot_fh);      close($allprot_fh);
163    
164  #    print "Content-Type: application/x-tar\n";      my $outname = "$subsystem.$$.tar.gz";
165      print "Content-Disposition:attachment;filename=$subsystem.tar.gz\n";      $outname =~ s/[^\w.-]/_/g;
166    
167        system("tar czf ../$outname .");
168        my $size = (stat("../$outname"))[7];
169    
170      print "Content-Type: application/octet-stream\n";      print "Content-Type: application/octet-stream\n";
171      #    print "Content-Encoding: x-gzip\n";      print "Content-Length: $size\n";
172        print "Content-Disposition:attachment;filename=$outname\n";
173      print "\n";      print "\n";
174      system("tar czf - .");  
175        my $buf;
176        open(my $myout, "<../$outname");
177        while (read($myout, $buf, 4096))
178        {
179            print $buf;
180        }
181        close($myout);
182    
183      chdir("..");      chdir("..");
184      system("rm -r $tmp");      system("rm -r $tmp $outname");
185    
186      exit;      exit;
187  }  }

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.5

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3