View Single Post
Old 10-20-2008, 05:45 PM   #1
sealbeater
Banned
sealbeater ought to be getting tired of karma fortunes by now.sealbeater ought to be getting tired of karma fortunes by now.sealbeater ought to be getting tired of karma fortunes by now.sealbeater ought to be getting tired of karma fortunes by now.sealbeater ought to be getting tired of karma fortunes by now.sealbeater ought to be getting tired of karma fortunes by now.sealbeater ought to be getting tired of karma fortunes by now.sealbeater ought to be getting tired of karma fortunes by now.sealbeater ought to be getting tired of karma fortunes by now.sealbeater ought to be getting tired of karma fortunes by now.sealbeater ought to be getting tired of karma fortunes by now.
 
Posts: 666
Karma: 1752814
Join Date: Jan 2008
Device: Sony Reader PRS-505 : Onyx Boox Max : Sony PRS-900 : Onyx Kepler Pro
Thumbs down How I got 4000 plus books to show

So, I am sure I am not alone when I say that the PRS-505 is a tad disappointing for those of us who have "large" collections. I've been struggling ever since I hit the first book number limit to get it to display more than 3000 books and I've finally made progress.

What I did was run a Csh script that I will post that moves the books into folders. I've named the folders "books-vol#". So far, and I am missing about 600 or so, I've gotten 4057 books to register with no problems so far reading them (no invalid page or protected page messages). I've currently got about 13 dirs or folders with 350 books per folder. When I feel like going through adding books again, I'm going to experiment with the number of files per folder.

Ok, starting at the beginning, I first tried 500 books per folder but once the reader hit 3000, the rest of the files won't display. The SD and MS cards seem to suffer from file corruption if you just load all your books on it at once. So, after putting all your books in one folder, find out how many you have and edit and run the csh script (only helpful if you are using a *nix based OS). This will put all of your books into corresponding folders. Then load those folders onto your reader one or at the most, two at a time. Size of the folder seems to have some correlation, so if you got a folder that's more than 2 gigs, you might want to pare it down.

So, if anyone wants to try, I would love to hear your results.

-- Start script --

#!/bin/csh

# Here are the variables that you will need to change:
################################################## ##############################
set number_of_files = 350 # This is the number of files that you
# expect to store in each directory
set total_files_to_move = 1816 # This is the total number of files that
# you will move with this utility
# you will move with this utility
set source_dir = ./ # set to 'current' directory
set target_dir = ./books.vol # This is the prefix that you'll use for
# the folder tree.

# Here are the 'static' variables that you will not change:
################################################## ##############################
#this number will increment the count cap
set count = 0
#iteration counters
set folder_counter = 1 # Starts at one, such that multiplication issues don't arise
set counter = 0

# Get your list of files
foreach file ( `ls -tr $source_dir` )
@ counter = $counter + 1
@ count = $number_of_files * $folder_counter

# Test to see if the first target directory exists
if (! -d $target_dir$folder_counter ) then
mkdir $target_dir$folder_counter
endif

# Test to see if the maximum number of files to move have been moved
if ($counter > ($total_files_to_move)) then
exit
endif


# Check to see if you should move on to the next folder or not...
if ($counter > $count) then
@ folder_counter++

# Test to see if subsequent target directory exists
if (! -d $target_dir$folder_counter ) then
mkdir $target_dir$folder_counter
endif

mv $source_dir/$file $target_dir$folder_counter/$file
endif
# Since you didn't need to increment the folder_counter - move the file as if nothing happene
if ($counter <= ($count)) then
mv $source_dir/$file $target_dir$folder_counter/$file
endif
end

-- End --

sealbeater is offline   Reply With Quote