Register Guidelines E-Books Search Today's Posts Mark Forums Read

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

Notices

Reply
 
Thread Tools Search this Thread
Old 01-11-2017, 05:06 PM   #1
dan3008
Member
dan3008 ought to be getting tired of karma fortunes by now.dan3008 ought to be getting tired of karma fortunes by now.dan3008 ought to be getting tired of karma fortunes by now.dan3008 ought to be getting tired of karma fortunes by now.dan3008 ought to be getting tired of karma fortunes by now.dan3008 ought to be getting tired of karma fortunes by now.dan3008 ought to be getting tired of karma fortunes by now.dan3008 ought to be getting tired of karma fortunes by now.dan3008 ought to be getting tired of karma fortunes by now.dan3008 ought to be getting tired of karma fortunes by now.dan3008 ought to be getting tired of karma fortunes by now.
 
Posts: 18
Karma: 606074
Join Date: Dec 2016
Device: KT3 - and loving it
Event on filechange

Hi guys

I was wondering if anyone knows of a way to make a script run on the kindle every time a particular file is changed (in this case deleted)?

I've seen incron and inotify, but no references to if either of them even exist for the kindle, let alone how to use them

any help would be appreciated.

thanks

dan
dan3008 is offline   Reply With Quote
Advert
Old 01-11-2017, 05:39 PM   #2
knc1
Analog Forever!
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 15,244
Karma: 16988039
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Quote:
Originally Posted by dan3008 View Post
Hi guys

I was wondering if anyone knows of a way to make a script run on the kindle every time a particular file is changed (in this case deleted)?

I've seen incron and inotify, but no references to if either of them even exist for the kindle, let alone how to use them

any help would be appreciated.

thanks

dan
inotify is a kernel function and it should be included (I think dBus uses it, something does).
Put the blocker directory in and monitor it for delete (check the bundled Lua libraries, there might already be a scripted interface to inotify included).
There should be a eips or lipc call that will toss up a death's head image on the screen.
knc1 is online now   Reply With Quote
Old 01-11-2017, 06:18 PM   #3
dan3008
Member
dan3008 ought to be getting tired of karma fortunes by now.dan3008 ought to be getting tired of karma fortunes by now.dan3008 ought to be getting tired of karma fortunes by now.dan3008 ought to be getting tired of karma fortunes by now.dan3008 ought to be getting tired of karma fortunes by now.dan3008 ought to be getting tired of karma fortunes by now.dan3008 ought to be getting tired of karma fortunes by now.dan3008 ought to be getting tired of karma fortunes by now.dan3008 ought to be getting tired of karma fortunes by now.dan3008 ought to be getting tired of karma fortunes by now.dan3008 ought to be getting tired of karma fortunes by now.
 
Posts: 18
Karma: 606074
Join Date: Dec 2016
Device: KT3 - and loving it
Quote:
Originally Posted by knc1 View Post
inotify is a kernel function and it should be included (I think dBus uses it, something does).
Put the blocker directory in and monitor it for delete (check the bundled Lua libraries, there might already be a scripted interface to inotify included).
There should be a eips or lipc call that will toss up a death's head image on the screen.
thanks for the quick reply, and the useful info, I've never used Lua, I'll have a look, Although, I'm tempted to see if there are inotify bindings for python, since thats my main programming language (although, my 4th best, vb.net, haskal and cobol are better, but python is more portable)

a death head image might be a bit overkill lol. I was going with something more subtle, such as a log file lol
dan3008 is offline   Reply With Quote
Old 01-11-2017, 06:38 PM   #4
knc1
Analog Forever!
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 15,244
Karma: 16988039
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
A lot of the Kindle's scripting is in Lua.
And of course, the Kindles need Lua installed because the window manager (Awesome) is programed with Lua (it isn't Java).

So if you dig around in */bin, */sbin you will find working examples.

Ah, python is only pre-installed in the factory images, not in the customer images.
knc1 is online now   Reply With Quote
Old 01-11-2017, 07:17 PM   #5
dan3008
Member
dan3008 ought to be getting tired of karma fortunes by now.dan3008 ought to be getting tired of karma fortunes by now.dan3008 ought to be getting tired of karma fortunes by now.dan3008 ought to be getting tired of karma fortunes by now.dan3008 ought to be getting tired of karma fortunes by now.dan3008 ought to be getting tired of karma fortunes by now.dan3008 ought to be getting tired of karma fortunes by now.dan3008 ought to be getting tired of karma fortunes by now.dan3008 ought to be getting tired of karma fortunes by now.dan3008 ought to be getting tired of karma fortunes by now.dan3008 ought to be getting tired of karma fortunes by now.
 
Posts: 18
Karma: 606074
Join Date: Dec 2016
Device: KT3 - and loving it
Id noticed about python... still, had a look at lua and i recon I can work with it, no harder than some of my other languages. I could write haskel for the kindle, but I really cant be bothered to work out the cross compile tool chain... lol

Thanks for the tips
dan3008 is offline   Reply With Quote
Advert
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Galaxy S4 Event 3.14 Marseille Android Devices 31 06-20-2013 02:12 AM


All times are GMT -4. The time now is 05:09 PM.


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