Skip to content

Commit

Permalink
Merge pull request #7 from openzim/multi_part_embedded
Browse files Browse the repository at this point in the history
  • Loading branch information
mgautierfr authored Feb 23, 2024
2 parents 28a1918 + c6d370e commit 261308f
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
Binary file added data/nons/small.zim.embedded.multi
Binary file not shown.
Binary file added data/withns/small.zim.embedded.multi
Binary file not shown.
20 changes: 20 additions & 0 deletions scripts/create_test_zimfiles
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,26 @@ printf "BEGINZIM" > small.zim.embedded \

zimfilesize=$(wc -c < small.zim)

printf "BEGINZIMMULTIPART" > small.zim.embedded.multi \
|| die 'Failed to create small.zim.embedded.multi'
towrite=$zimfilesize
skip=0
while [ $towrite -gt 2048 ]
do
dd bs=1 skip=${skip} count=2048 conv=notrunc if=small.zim of=small.zim.embedded.multi oflag=append 2>/dev/null \
|| die 'Failed to create small.zim.embedded.multi'
printf "NEWSECTIONZIMMULTI" >> small.zim.embedded.multi \
|| die 'Failed to create small.zim.embedded.multi'
skip=$(( $skip + 2048 ))
towrite=$(( $towrite - 2048 ))
done
dd bs=1 skip=${skip} count=${towrite} conv=notrunc if=small.zim of=small.zim.embedded.multi oflag=append 2>/dev/null \
|| die 'Failed to create small.zim.embedded.multi'
printf "ENDZIMMULTIPART" >> small.zim.embedded.multi \
|| die 'Failed to create small.zim.embedded.multi'

echo 'small.zim.embedded.multi was successfully created'

zimheader=$($scriptdir/inspectzim --header small.zim|tail -n +2)

encode_integer_as_printf_fmt_string()
Expand Down

0 comments on commit 261308f

Please sign in to comment.