Power Status (was Re: Because LC can't do two things at once.)
Mark Wieder
mwieder at ahsoftware.net
Fri Mar 6 14:26:33 EST 2015
Peter M. Brigham <pmbrig at ...> writes:
>
> So can a couple of Unix users out there test this part out?
>
> if there is a file "/sys/class/power_supply/BAT0" then
> put url "/sys/class/power_supply/BAT0" into tStatus
> else if there is a file "/sys/class/power_supply/BAT1" then
> put url "/sys/class/power_supply/BAT1" into tStatus
Once again, you're checking a directory, not a file.
So you either want "if there is a folder" instead of "if there is a file"
or you want 'if there is a file "/sys/class/power_supply/BAT0/status"'
and you need to grab the actual file contents:
put url "/sys/class/power_supply/BAT0/status" into tStatus
--
Mark Wieder
ahsoftware at gmail.com
More information about the use-livecode
mailing list