SourceFiles.org - Use the Source, Luke
Home | Register | News | Forums | Guide | MyLinks | Bookmark

Related Sites

Latest News
  General News
  Reviews
  Press Releases
  Software
  Hardware
  Security
  Tutorials
  Off Topic


Back to files

devices/linux

AUTHOR

        Mathieu Bouchard <matju@sympatico.ca>
        irc: irc.openprojects.net / #ruby-lang / matju
        (note: I can't read Japanese; write in French or English please)

OVERVIEW

This is a collection of simple modules that you extend IO objects with, to give them support for specific devices. For example:

        require "linux/SoundMixer"
        f = File.open "/dev/mixer"
        f.extend Linux::SoundMixer

        # f now has special accessors for driver variables, e.g:

        f.treble = left_speaker_percent + 256 * right_speaker_percent

The modules are made of automatically generated methods, much like Ruby's accessors. those generators are called ioctl_reader, ioctl_writer, ioctl_accessor. Writing expects an integer in -2**31...2**31; reading will return the same. You may browse the source to find out which accessors are available, and it's easy to add support for more features.


Other Sites

Discussion Groups
  Beginners
  Distributions
  Networking / Security
  Software
  PDAs

About | FAQ | Privacy | Awards | Contact
Comments to the webmaster are welcome.
Copyright 2006 Sourcefiles.org All rights reserved.