![]() |
#46 |
Enthusiast
![]() ![]() ![]() ![]() ![]() ![]() ![]() 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.
|
![]() |
![]() |
![]() |
#47 |
Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 21
Karma: 12650
Join Date: Apr 2011
Device: PB903
|
thank you, friends
|
![]() |
![]() |
Advert | |
|
![]() |
#48 |
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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 ![]() |
![]() |
![]() |
![]() |
#49 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,007
Karma: 18401861
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 03:33 PM. |
![]() |
![]() |
![]() |
#50 |
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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 ![]() |
![]() |
![]() |
Advert | |
|
![]() |
#51 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,007
Karma: 18401861
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. |
![]() |
![]() |
![]() |
#52 |
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 117
Karma: 37584
Join Date: Nov 2012
Location: Milan / Italy
Device: pocketbook touch 622
|
![]()
wow I'll test it
thanks a lot paolo ![]() |
![]() |
![]() |
![]() |
#53 |
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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 03:40 AM. |
![]() |
![]() |
![]() |
#54 |
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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. |
![]() |
![]() |
![]() |
#55 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,007
Karma: 18401861
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? |
![]() |
![]() |
![]() |
#56 |
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 142
Karma: 669192
Join Date: Nov 2013
Device: Kindle 4.1.1 no touch
|
* 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. |
![]() |
![]() |
![]() |
#57 |
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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# |
![]() |
![]() |
![]() |
#58 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,007
Karma: 18401861
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. |
![]() |
![]() |
![]() |
#59 |
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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 |
![]() |
![]() |
![]() |
#60 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,007
Karma: 18401861
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.
|
![]() |
![]() |
![]() |
|
![]() |
||||
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 08:55 PM |
Application update: application not installed error | Merischino | Kindle Fire | 4 | 12-01-2011 10:30 PM |
erm, simple question , hope for simple answer! | al zymers | Amazon Kindle | 5 | 09-25-2010 01:01 PM |
Simple question for a simple mind :) | PKFFW | OpenInkpot | 6 | 08-27-2009 09:00 PM |
Television scripts for your handheld | Bob Russell | Lounge | 2 | 01-07-2006 06:22 PM |