BrowserUk has asked for the wisdom of the Perl Monks concerning the following question:
Using
perl -e"BEGIN{$/=\2**21;binmode STDIN; $n=0}" -ne"open my $fh,'>:raw', $ARGV.'.'.$n++; print $fh $_;" junk2
to split a 34,000,000 byte file, I get
19/05/2005 22:01 34,000,000 junk2 05/08/2005 10:22 2,097,152 junk2.0 05/08/2005 10:22 2,097,152 junk2.1 05/08/2005 10:22 2,097,152 junk2.10 05/08/2005 10:22 2,097,152 junk2.11 05/08/2005 10:22 2,097,152 junk2.12 05/08/2005 10:22 2,097,152 junk2.13 05/08/2005 10:22 2,097,152 junk2.14 05/08/2005 10:22 1,542,720 junk2.15 05/08/2005 10:09 1,000,000 junk2.16 05/08/2005 10:22 2,097,152 junk2.2 05/08/2005 10:22 2,097,152 junk2.3 05/08/2005 10:22 2,097,152 junk2.4 05/08/2005 10:22 2,097,152 junk2.5 05/08/2005 10:22 2,097,152 junk2.6 05/08/2005 10:22 2,097,152 junk2.7 05/08/2005 10:22 2,097,152 junk2.8 05/08/2005 10:22 2,097,152 junk2.9 05/08/2005 10:25 34,000,000 this
When I reassemble the parts (the file named 'this' above), and diff it against the original, they are identical.
My question is, why did the last two files (.15 & .16) get written with sizes 1,542,720 & 1,000,000 repectively?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: A puzzle.
by virtualsue (Vicar) on Aug 06, 2005 at 08:47 UTC | |
by BrowserUk (Patriarch) on Aug 06, 2005 at 09:16 UTC | |
by graff (Chancellor) on Aug 06, 2005 at 15:47 UTC | |
|
Re: A puzzle.
by borisz (Canon) on Aug 06, 2005 at 08:46 UTC | |
|
Re: A puzzle.
by NateTut (Deacon) on Aug 06, 2005 at 11:55 UTC |