Sys files read

Matt Graham danceswithcrows at usa.net
Mon Nov 2 12:02:58 MST 2009


From: Marco Savo <savomarco at gmail.com>
> I have to create a program that reads from the /sys files.
> These files contains a single value and are in different directories.
> There isn't a easy way to read these values? some function of the
> sysfs for example?

sysfs is a great example of second-system effect.  /proc was a lot
easier to deal with in most cases, as it looked like it was meant
to be human-readable.  No such design consideration existed for
sysfs.  There's a package called sysfsutils that attempts to give
people a set of userspace functions to get a bunch of data out of
sysfs with less hassle than trying to get it directly.  It may be
called "libsysfs" depending on distro.

I don't know if it'll help you out since you didn't provide any
details on what it is that you're trying to do, but it's a place to
start.

-- 
Matt G / Dances With Crows
The Crow202 Blog:  http://crow202.org/wordpress/
There is no Darkness in Eternity/But only Light too dim for us to see






More information about the PLUG-discuss mailing list