knight.of.ni has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/env perl use strict; use warnings; my $dateiread = "/home/ni/OUTPUT/test.png"; my $dateiwrite = "/home/ni/OUTPUT/test2.png"; my $buffer; my $zeichen; my $bytes = 4; open (my $handle1, "<", $dateiread); open (my $handle2, ">", $dateiwrite); while (my $zeichen = getc($handle1)) { seek($handle1, -1, 1); read($handle1, $buffer, $bytes); if ($buffer =~ /IEND/g) { print $handle2 $buffer; exit; } seek($handle1, -3, 1); print $handle2 $zeichen; } close ($handle1); close ($handle2);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: File extraction 2nd try
by tangent (Parson) on Jan 19, 2016 at 03:33 UTC | |
|
Re: File extraction 2nd try
by AnomalousMonk (Archbishop) on Jan 19, 2016 at 03:11 UTC | |
|
Re: File extraction 2nd try
by Athanasius (Archbishop) on Jan 19, 2016 at 04:16 UTC | |
by knight.of.ni (Initiate) on Jan 19, 2016 at 18:41 UTC | |
|
Re: File extraction 2nd try
by GrandFather (Saint) on Jan 19, 2016 at 05:14 UTC | |
by knight.of.ni (Initiate) on Jan 19, 2016 at 19:10 UTC | |
by GrandFather (Saint) on Jan 19, 2016 at 20:04 UTC |