View Single Post
Old 03-19-2011, 04:45 PM   #19
Junior Member
dino8352 is on a distinguished road
Posts: 2
Karma: 72
Join Date: Oct 2008
Device: T-Mobile MyTouch 4G running Aldiko reader
shell script workaround to prevent ebook-viewer from modifying

Not sure how long these changes will take to filter into official deployed Calibre, but I still have the file-destructive version of ebook-viewer on my system. I made this easy workaround as an alternative to hacking the program:

Save this shell script as ebook-viewer somewhere on the path BEFORE /usr/bin/ebook-viewer:
#! /bin/bash

# The ebook-viewer utility of the Calibre project MODIFIES ANY EPUB 
# DOCUMENT THAT'S OPENED WITH IT. A bookmarks file is inserted into 
# the book. I know of no way at this time to prevent it from doing so 
# short of turning off all write bits on the files or hacking the
# program.

# This script is a crude solution, let ebook-viewer touch a junk copy 
# of the book in /tmp

tmpFile="/tmp/$(basename $1)"
cp $1 $tmpFile
/usr/bin/ebook-viewer $tmpFile
rm $tmpFile

Last edited by dino8352; 03-19-2011 at 04:46 PM. Reason: forgot title
dino8352 is offline   Reply With Quote