Power Status (was Re: Because LC can't do two things at once.)

Richard Gaskin ambassador at fourthworld.com
Fri Mar 6 23:48:35 EST 2015


Peter M. Brigham wrote:

 > So the acid test is what works. Can someone please test it on a
 > unix machine and tell us what the format for the URL should be?
 > And whether all the cases for the file contents are covered?

OS X is a certified Unix, so as far as bash is concerned what works 
there will work on most Unix systems.

In general terms (read, "for programs other than LC") Mark spot-on with 
the "<class><colon><slash><slash><URI>" convention.  But as in so many 
other areas, LiveCode seems a little different.

For file access on Linux (and Mac and Windows) I always use simply 
"file:/path/to/somefile" and it works well.

Back to the original power status question, oddly enough the file I/O 
routines LC uses don't seem to allow me to use the same URL syntax we 
use for files.

This works, though:

    put shell("cat /sys/class/power_supply/BAT1/status")

-- 
  Richard Gaskin
  Fourth World Systems
  Software Design and Development for Desktop, Mobile, and Web
  ____________________________________________________________
  Ambassador at FourthWorld.com        http://www.FourthWorld.com




More information about the use-livecode mailing list