diff options
author | Dimitri van Heesch <dimitri@stack.nl> | 2013-05-12 13:04:34 (GMT) |
---|---|---|
committer | Dimitri van Heesch <dimitri@stack.nl> | 2013-05-12 13:04:34 (GMT) |
commit | 8dc4ff6dd22b1603f33537ff03994cc63e658768 (patch) | |
tree | 97f0e23b93d45b7917d965e6d1bb70da6c61831a /jquery/split_jquery.pl | |
parent | ebf4b3641c9149eaf4468aa8df64e1c7517e5f0c (diff) | |
download | Doxygen-8dc4ff6dd22b1603f33537ff03994cc63e658768.zip Doxygen-8dc4ff6dd22b1603f33537ff03994cc63e658768.tar.gz Doxygen-8dc4ff6dd22b1603f33537ff03994cc63e658768.tar.bz2 |
Release-1.8.3.1-20130512
Diffstat (limited to 'jquery/split_jquery.pl')
-rw-r--r-- | jquery/split_jquery.pl | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/jquery/split_jquery.pl b/jquery/split_jquery.pl new file mode 100644 index 0000000..3edc763 --- /dev/null +++ b/jquery/split_jquery.pl @@ -0,0 +1,25 @@ +# script to split file into parts of roughly 32kb +#!/bin/perl +my $file = shift; +my $target = shift; +my $count = 1; +my $len = 0; +$target=~/p(\d+).js/; +my $part = $1; +open(F,"<$file") || die ("cannot open file for reading: $!"); +open(G,">$target") || die("cannot open file for writing: $!"); +while (<F>) +{ + if ($part==$count) + { + print G "$_"; + } + $len+=length($_); + if ($len>32768) + { + $len=0; + $count++; + } +} +close(F); +close(G); |