Leser: 1
|< 1 2 >| | 11 Einträge, 2 Seiten |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
#!/usr/bin/perl use strict; my $file1_in = "text.txt"; my $file1_out = "text.bin"; my $file2_in = "bine.bin"; my $file2_out = "bine.txt"; if(open(FILE1_IN, "< $file1_in")) { my $data = join "", <FILE1_IN>; close(FILE1_IN); if(open(FILE1_OUT, "> $file1_out")) { binmode(FILE1_OUT); syswrite(FILE1_OUT, $data); close(FILE1_OUT); } } if(open(FILE2_IN, "< $file2_in")) { binmode(FILE2_IN); my ($len, $off, $data, $buf) = (0, 0, "", undef); while($len = sysread(FILE2_IN, $buf, 1024, $off)) { $data .= $buf; $off += $len; } close(FILE1_IN); if(open(FILE2_OUT, "> $file2_out")) { print FILE2_OUT $data; close(FILE1_OUT); } }
|< 1 2 >| | 11 Einträge, 2 Seiten |