Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > PocketBook > PocketBook Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 01-10-2012, 04:10 PM   #46
JustForFun
Enthusiast
JustForFun has learned how to read e-booksJustForFun has learned how to read e-booksJustForFun has learned how to read e-booksJustForFun has learned how to read e-booksJustForFun has learned how to read e-booksJustForFun has learned how to read e-booksJustForFun has learned how to read e-books
 
Posts: 30
Karma: 752
Join Date: Nov 2010
Device: PB360
Take a look at this question on stackoverflow. Using isspace() also removes the newline at the end of the line which fgets() leaves there if the line is shorter than the supplied buffer.
JustForFun is offline   Reply With Quote
Old 01-14-2012, 02:08 AM   #47
bogomil
Member
bogomil can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterbogomil can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterbogomil can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterbogomil can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterbogomil can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterbogomil can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterbogomil can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterbogomil can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterbogomil can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterbogomil can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterbogomil can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameter
 
Posts: 21
Karma: 12650
Join Date: Apr 2011
Device: PB903
thank you, friends
bogomil is offline   Reply With Quote
Advert
Old 01-07-2013, 05:09 PM   #48
paolog
Zealot
paolog can name that ebook in five wordspaolog can name that ebook in five wordspaolog can name that ebook in five wordspaolog can name that ebook in five wordspaolog can name that ebook in five wordspaolog can name that ebook in five wordspaolog can name that ebook in five wordspaolog can name that ebook in five wordspaolog can name that ebook in five wordspaolog can name that ebook in five wordspaolog can name that ebook in five words
 
paolog's Avatar
 
Posts: 117
Karma: 37584
Join Date: Nov 2012
Location: Milan / Italy
Device: pocketbook touch 622
hi

I'm a new owner of a pb touch (622) so I'm loading and erasing many things, even only to test purpose.

I noticed that in
/mnt/ext1/system/state

and in
/mnt/ext1/system/config/'Active Contents'

it left files related to deleted book even if you ask to optimize the database;

did anyone make a script to delete (even interactively) those files?

now I'm doing it by hand with poterm, but should be nice automate it

paolog is offline   Reply With Quote
Old 01-12-2013, 04:31 PM   #49
rkomar
Wizard
rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.
 
Posts: 3,015
Karma: 18765431
Join Date: Oct 2010
Location: Sudbury, ON, Canada
Device: PRS-505, PB 902, PRS-T1, PB 623, PB 840, PB 633
I guess no one has such a script already. I don't think it needs to be interactive, because it just needs to find data in those directories that doesn't have an existing ebook for it, and then delete it. Thus, you wouldn't need to use the sh_ivtool application for interactivity. I think the script would be a lot simpler if it could use the Unix find utility to look for the .af0 files, since they are spread out in directories that match the structure where the ebooks are. If no one else comes up with such a script first, I'll try to write something over the next few days.

P.S. Deleting books using the Library application usually deletes the extra information, as well. If you are deleting using the USB connection, maybe you should use the Library app instead.

Last edited by rkomar; 01-12-2013 at 04:33 PM.
rkomar is offline   Reply With Quote
Old 01-19-2013, 01:47 PM   #50
paolog
Zealot
paolog can name that ebook in five wordspaolog can name that ebook in five wordspaolog can name that ebook in five wordspaolog can name that ebook in five wordspaolog can name that ebook in five wordspaolog can name that ebook in five wordspaolog can name that ebook in five wordspaolog can name that ebook in five wordspaolog can name that ebook in five wordspaolog can name that ebook in five wordspaolog can name that ebook in five words
 
paolog's Avatar
 
Posts: 117
Karma: 37584
Join Date: Nov 2012
Location: Milan / Italy
Device: pocketbook touch 622
thanks rkmoar
the interaction could be useful in case one would save annotations and highlights that sometimes became complex


i use this this script named clean.app at the moment to delete empty dir

i cd to the directory because with busybox once i deleted anything!

#!/bin/sh

cd /mnt/ext1/system/state

path to find/find -depth -type d -epty - exec rmdir {} \;

cd /mnt/ext1/system/config/Active\ Contents

path to find/find -depth -type d -epty - exec rmdir {} \;

i've to study more to compare paths as you suggested

paolog is offline   Reply With Quote
Advert
Old 01-19-2013, 03:07 PM   #51
rkomar
Wizard
rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.
 
Posts: 3,015
Karma: 18765431
Join Date: Oct 2010
Location: Sudbury, ON, Canada
Device: PRS-505, PB 902, PRS-T1, PB 623, PB 840, PB 633
I wrote a script last weekend, but put off uploading it because I wanted to include a version of find for the older 3XX ereader models. However, I'm not sure that the notes are in the same format on those devices, so I think I'll just release the script for the Pro models only.

The script deletes all the state data and notes for ebooks that aren't on the device any longer. To make the script simpler, I used find and bash, and included them in the zip file.

As you noted, deleting the notes may not be what is wanted. However, making the script interactive would make it tedious to use. If you want to save notes, I think it's better to just comment out the notes handling stuff in the script, and just use the Notes application to delete unwanted notes.
Attached Files
File Type: zip clean_state-Pro.zip (643.4 KB, 640 views)
rkomar is offline   Reply With Quote
Old 01-25-2013, 04:16 AM   #52
paolog
Zealot
paolog can name that ebook in five wordspaolog can name that ebook in five wordspaolog can name that ebook in five wordspaolog can name that ebook in five wordspaolog can name that ebook in five wordspaolog can name that ebook in five wordspaolog can name that ebook in five wordspaolog can name that ebook in five wordspaolog can name that ebook in five wordspaolog can name that ebook in five wordspaolog can name that ebook in five words
 
paolog's Avatar
 
Posts: 117
Karma: 37584
Join Date: Nov 2012
Location: Milan / Italy
Device: pocketbook touch 622
Smile

wow I'll test it
thanks a lot
paolo
paolog is offline   Reply With Quote
Old 10-02-2013, 04:38 AM   #53
paolog
Zealot
paolog can name that ebook in five wordspaolog can name that ebook in five wordspaolog can name that ebook in five wordspaolog can name that ebook in five wordspaolog can name that ebook in five wordspaolog can name that ebook in five wordspaolog can name that ebook in five wordspaolog can name that ebook in five wordspaolog can name that ebook in five wordspaolog can name that ebook in five wordspaolog can name that ebook in five words
 
paolog's Avatar
 
Posts: 117
Karma: 37584
Join Date: Nov 2012
Location: Milan / Italy
Device: pocketbook touch 622
hi rkomar

the script you posted to clean up, that worked perfectly until 4.0 fw of 622, now unfortunately cleans also 'live' notes.

not a big problem for me, but it could be an issue to s.o. that has important notes and didn'n comment that part of the script

bye

paolo

Last edited by paolog; 10-02-2013 at 04:40 AM.
paolog is offline   Reply With Quote
Old 08-11-2020, 05:07 PM   #54
Skeeve
Zealot
Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.
 
Skeeve's Avatar
 
Posts: 142
Karma: 669192
Join Date: Nov 2013
Device: Kindle 4.1.1 no touch
Thanks for this very useful tool.

While I think the directory- / fileselector can be improved a lot, it's already extremely useful for scripting stuff.

I will change my "OwnSudoku" to make use of your tool.

I'm using it on a Touch HD3 btw.
Skeeve is offline   Reply With Quote
Old 08-11-2020, 05:55 PM   #55
rkomar
Wizard
rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.
 
Posts: 3,015
Karma: 18765431
Join Date: Oct 2010
Location: Sudbury, ON, Canada
Device: PRS-505, PB 902, PRS-T1, PB 623, PB 840, PB 633
The directory selector is showing its age. I can barely use it on my Inkpad because the entries are so small. I implemented my own from the OpenContents() dialog recently in pbimageviewer. I may add it as an option to sh_ivtool in case it works better than OpenDirectorySelector() for some.

What improvements would you want in the file selector?
rkomar is offline   Reply With Quote
Old 08-12-2020, 06:02 AM   #56
Skeeve
Zealot
Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.
 
Skeeve's Avatar
 
Posts: 142
Karma: 669192
Join Date: Nov 2013
Device: Kindle 4.1.1 no touch
Quote:
Originally Posted by rkomar View Post
What improvements would you want in the file selector?
* As you already noted: Much to small
* Navigating the directories would be fine
* Maybe just mimicking the explorer-3 maybe but on directory not on database basis.

When I use -F and there is no file with that extension in the directory I simply get the information that nothing was found. When I use -f, I get all matching files in all subdirectories.

Would be nice to have -F show all matching file plus every Directory. When a directory is selected, change into that and display all Directories and all matching files. Have a ".." entry to go to the parent directory.

Another question: How do you compile for the PocketBook? I'd like to set up a Docker Image to be able to compile myself, but couldn't understand yet what's required.
Skeeve is offline   Reply With Quote
Old 10-16-2021, 12:23 PM   #57
Skeeve
Zealot
Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.
 
Skeeve's Avatar
 
Posts: 142
Karma: 669192
Join Date: Nov 2013
Device: Kindle 4.1.1 no touch
In my (more or less) fruitless endeavours to get things compiled for my pocketbook, using Docker Containers, I also looked at your sh_ivtool, @rkomar.

I got the 1.1 Version of Sergey Vlasov's PBSDK package installed (at least I think so), but running make simply gives:

Code:
root@9430fb83d41f:/project# make 
make: Nothing to be done for 'all'.
root@9430fb83d41f:/project#
Skeeve is offline   Reply With Quote
Old 10-16-2021, 05:41 PM   #58
rkomar
Wizard
rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.
 
Posts: 3,015
Karma: 18765431
Join Date: Oct 2010
Location: Sudbury, ON, Canada
Device: PRS-505, PB 902, PRS-T1, PB 623, PB 840, PB 633
It's true that my Makefile assumes a make system just like that provided by Sergey Vlasov's PBSDK. You build for a target platform using the BUILD environmental variable. I believe that Sergey's SDK provides toolchains for the BUILD=arm (ancient firmware version1 devices) and BUILD=arm_gnueabi (really old firmware version 2, 3 and 4 devices). Try "make BUILD=arm_gnueabi" to see if that works.

I liked that SDK system, so I've been rolling my own toolchain versions having the same structure but based on more recent official SDKs. Unfortunately, that's not much help for people like you who want to build it themselves. You are probably better off writing your own make or cmake file based on the SDK that matches your device. The sh_tool build is really simple, you just compile main.c and link it against the Inkview library (plus whatever other libraries libinkview requires). Here's what building for arm_fwv6 looks like for me:

robpc4>make BUILD=arm_fwv6
mkdir obj_arm_fwv6
arm-obreey6-linux-gnueabi-gcc -c -o obj_arm_fwv6/main.c.o -Os -D__ARM__ -Wall -fomit-frame-pointer -Wno-write-strings -MTobj_arm_fwv6/main.c.o -MF`echo obj_arm_fwv6/main.c.o | sed -e 's,\.o$,.d,'` -MD -MP main.c
arm-obreey6-linux-gnueabi-g++ -o obj_arm_fwv6/sh_ivtool.app obj_arm_fwv6/main.c.o -Wl,-s -linkview

You can probably even run those last two commands by hand, replacing arm-obreey6-linux-gnueabi-gcc/arm-obreey6-linux-gnueabi-g++ with whatever gcc compiler you have in your latest pocketbook SDK. The program will end up in obj_arm_fwv6/sh_ivtool.app.
rkomar is offline   Reply With Quote
Old 10-17-2021, 03:01 AM   #59
Skeeve
Zealot
Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.
 
Skeeve's Avatar
 
Posts: 142
Karma: 669192
Join Date: Nov 2013
Device: Kindle 4.1.1 no touch
Ups… Please let's rewind…

"arm-obreey6-linux-gnueabi-gcc"

What's that and where can I get it?

Sergey's SDK 1.1 I got from here: https://storage.googleapis.com/dennw...inux-1.1.0.deb

I also have, from Github the SDK 6.0.3, but an arm-obreey6 I cannot find. These are all the *-gcc in my dockercontainer I have after unpacking the 6.0.3 and installing Sergey's

Code:
/usr/bin/arm-none-linux-gnueabi-gcc
/usr/bin/arm-linux-gcc
/usr/bin/c99-gcc
/usr/bin/c89-gcc
/usr/bin/x86_64-linux-gnu-gcc
/SDK_6.3.0/SDK-iMX6/usr/bin/arm-linux-gcc
/SDK_6.3.0/SDK-iMX6/usr/bin/arm-obreey-linux-gnueabi-gcc
/SDK_6.3.0/SDK-B288/usr/bin/arm-linux-gcc
/SDK_6.3.0/SDK-B288/usr/bin/arm-obreey-linux-gnueabi-gcc
/SDK_6.3.0/SDK-A13/usr/bin/arm-linux-gcc
/SDK_6.3.0/SDK-A13/usr/bin/arm-obreey-linux-gnueabi-gcc
Skeeve is offline   Reply With Quote
Old 10-17-2021, 11:07 AM   #60
rkomar
Wizard
rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.
 
Posts: 3,015
Karma: 18765431
Join Date: Oct 2010
Location: Sudbury, ON, Canada
Device: PRS-505, PB 902, PRS-T1, PB 623, PB 840, PB 633
SDK_481 and SDK_6.3.0 both contain arm-obreey-linux-gnueabi-gcc, but they are different versions of gcc. I couldn't keep both with the same name in /usr/bin, so I rebuilt the compilers for SDK_6.3.0 myself and changed the name slightly (adding the '6'). Now, when building firmware version 5 programs, I use arm-obreey-linux-gnueabi-gcc, and when building firmware version 6 programs, I use arm-obreey6-linux-gnueabi-gcc. It was my solution to a problem that only I have. You can just use /SDK_6.3.0/SDK-B288/usr/bin/arm-obreey-linux-gnueabi-gcc" for this.
rkomar is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Trio of Picture Books - Simple Animals, Simple Shapes, and You're My Baby! Manley Peterson Self-Promotions by Authors and Publishers 5 01-06-2012 09:55 PM
Application update: application not installed error Merischino Kindle Fire 4 12-01-2011 11:30 PM
erm, simple question , hope for simple answer! al zymers Amazon Kindle 5 09-25-2010 02:01 PM
Simple question for a simple mind :) PKFFW OpenInkpot 6 08-27-2009 10:00 PM
Television scripts for your handheld Bob Russell Lounge 2 01-07-2006 07:22 PM


All times are GMT -4. The time now is 11:15 AM.


MobileRead.com is a privately owned, operated and funded community.