View Single Post
Old 04-22-2013, 09:18 PM   #3
twobob
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Týr
twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.
 
twobob's Avatar
 
Posts: 6,491
Karma: 5977000
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
Quote:
Originally Posted by hfpop View Post
After removing a book on Paperwhite, using the usual interface method (i.e. no USB or otherwise), the book-filename.sdr folder is still there, inside the documents folder. It will have to be removed manually. I find this very annoying.

Is there a solution to this problem? Maybe a script to clean documents folder, written for Kindle Launcher?
Code:
REPORT="/mnt/us/documents/FolderReport.txt"; rm -f $REPORT ; echo "new Report `date`" > $REPORT; IFS=$'\n'; for TEST in $(ls -d /mnt/us/documents/* | grep .sdr); do echo -ne "\r\rFOLDER= $TEST\r" >> $REPORT; TEST2=$(ls -Al "`dirname \"$TEST\"`""/""`echo "$TEST"| sed 's|.*\/\([^\.]*\)\(\..*\)$|\1|g'`".*"" | grep -v 'sdr' | grep "`dirname \"$TEST\"`" ) ; echo "MATCHING DOCUMENT= --[""$TEST2""]--" >> $REPORT; if [ -z "$TEST2" ]; then echo "DELETION CANDIDATE SELECTED $TEST" >> $REPORT ; rm -rf "$TEST" ;fi; done;


something like that

Code:
new Report Tue Apr 23 09:01:22 UTC 2013

FOLDER= /mnt/us/documents/3rd Sight_ A Horror Novel_123.sdr
MATCHING DOCUMENT= --[-rwxr-xr-x    1 root     root        399924 Mar  1 16:22 /mnt/us/documents/3rd Sight_ A Horror Novel_123.azw3]--

FOLDER= /mnt/us/documents/Ash_123.sdr
MATCHING DOCUMENT= --[-rwxr-xr-x    1 root     root        759140 Sep 20  2012 /mnt/us/documents/Ash_123.azw3]--

FOLDER= /mnt/us/documents/Battery-2013-02-28T17.50UTC.sdr
MATCHING DOCUMENT= --[]--
DELETION CANDIDATE SELECTED /mnt/us/documents/Battery-2013-02-28T17.50UTC.sdr

FOLDER= /mnt/us/documents/Chinese Chess Rules - Awak.sdr
MATCHING DOCUMENT= --[-rwxr-xr-x    1 root     root        383635 Feb 27 23:59 /mnt/us/documents/Chinese Chess Rules - Awak.azw3]--

FOLDER= /mnt/us/documents/Cloud Atlas_123.sdr
MATCHING DOCUMENT= --[-rwxr-xr-x    1 root     root       1371188 Apr  7 11:13 /mnt/us/documents/Cloud Atlas_123.azw3]--

FOLDER= /mnt/us/documents/Countdown_ H Hour_123.sdr
MATCHING DOCUMENT= --[-rwxr-xr-x    1 root     root        712620 Jan 11 06:47 /mnt/us/documents/Countdown_ H Hour_123.azw]--

FOLDER= /mnt/us/documents/Csound5.18_manual.sdr
MATCHING DOCUMENT= --[-rwxr-xr-x    1 root     root      11231282 Aug 28  2012 /mnt/us/documents/Csound5.18_manual.pdf]--

FOLDER= /mnt/us/documents/FolderReport.sdr
MATCHING DOCUMENT= --[-rwxr-xr-x    1 root     root          1366 Apr 23 01:15 /mnt/us/documents/FolderReport.txt]--

FOLDER= /mnt/us/documents/IMX50SDG.sdr
MATCHING DOCUMENT= --[-rwxr-xr-x    1 root     root       2182355 Sep 23  2012 /mnt/us/documents/IMX50SDG.pdf]--

FOLDER= /mnt/us/documents/Klingon.sdr
MATCHING DOCUMENT= --[-rwxr-xr-x    1 root     root        277482 Mar  7 03:17 /mnt/us/documents/Klingon.mobi]--

FOLDER= /mnt/us/documents/My Clippings.sdr
MATCHING DOCUMENT= --[]--
DELETION CANDIDATE SELECTED /mnt/us/documents/My Clippings.sdr

FOLDER= /mnt/us/documents/My_Own_Kind_of_Freedom.sdr
MATCHING DOCUMENT= --[-rwxr-xr-x    1 root     root        426966 Mar  8 19:33 /mnt/us/documents/My_Own_Kind_of_Freedom.mobi]--

FOLDER= /mnt/us/documents/Vulcan.sdr
MATCHING DOCUMENT= --[-rwxr-xr-x    1 root     root        651312 Mar  7 03:17 /mnt/us/documents/Vulcan.mobi]--

FOLDER= /mnt/us/documents/WAFs info.sdr
MATCHING DOCUMENT= --[]--
DELETION CANDIDATE SELECTED /mnt/us/documents/WAFs info.sdr

FOLDER= /mnt/us/documents/XWINSYS.sdr
MATCHING DOCUMENT= --[-rwxr-xr-x    1 root     root       1545159 Dec 17 04:00 /mnt/us/documents/XWINSYS.PDF]--

FOLDER= /mnt/us/documents/botsies.sdr
MATCHING DOCUMENT= --[-rwxr-xr-x    1 root     root        168499 Mar 23 18:50 /mnt/us/documents/botsies.mobi]--

FOLDER= /mnt/us/documents/dmesg-2013-04-01T22.09UTC.sdr
MATCHING DOCUMENT= --[-rwxr-xr-x    1 root     root         15583 Apr  1 22:09 /mnt/us/documents/dmesg-2013-04-01T22.09UTC.txt]--

FOLDER= /mnt/us/documents/doc32082.sdr
MATCHING DOCUMENT= --[-rwxr-xr-x    1 root     root        152785 Oct  9  2012 /mnt/us/documents/doc32082.pdf]--

FOLDER= /mnt/us/documents/dotsies.sdr
MATCHING DOCUMENT= --[]--
DELETION CANDIDATE SELECTED /mnt/us/documents/dotsies.sdr

FOLDER= /mnt/us/documents/gtkLog.sdr
MATCHING DOCUMENT= --[-rwxr-xr-x    1 root     root         20480 Apr 15 19:23 /mnt/us/documents/gtkLog.txt]--

FOLDER= /mnt/us/documents/kindle_waf_guide.sdr
MATCHING DOCUMENT= --[-rwxr-xr-x    1 root     root         10292 Sep 24  2012 /mnt/us/documents/kindle_waf_guide.mobi]--

FOLDER= /mnt/us/documents/nadsat.sdr
MATCHING DOCUMENT= --[-rwxr-xr-x    1 root     root        204611 Mar 17 21:32 /mnt/us/documents/nadsat.mobi]--

FOLDER= /mnt/us/documents/nadsat_test.sdr
MATCHING DOCUMENT= --[-rwxr-xr-x    1 root     root          9486 Mar  7 03:18 /mnt/us/documents/nadsat_test.mobi]--


EDITS:
v4 - Fixed typo in menu.json (twice)
v3 - made reports have internal timestamps and to correctly update "most recent" report when sorted by recency.
v2 - Added corrected line-spacing escapes to reports
v1 - Made it work
Attached Thumbnails
Click image for larger version

Name:	Selection_480.png
Views:	137
Size:	14.9 KB
ID:	104818   Click image for larger version

Name:	Selection_481.png
Views:	146
Size:	14.0 KB
ID:	104819   Click image for larger version

Name:	Selection_484.png
Views:	143
Size:	66.4 KB
ID:	104820   Click image for larger version

Name:	Selection_482.png
Views:	148
Size:	66.7 KB
ID:	104821   Click image for larger version

Name:	Selection_483.png
Views:	116
Size:	14.1 KB
ID:	104822  
Attached Files
File Type: zip FolderPruner.zip (1.4 KB, 63 views)

Last edited by twobob; 04-23-2013 at 05:02 AM.
twobob is offline   Reply With Quote